From 2ea18a0b7aa9150a816382eeeba7045433ec73fe Mon Sep 17 00:00:00 2001 From: zhenyan121 <3367366583@qq.com> Date: Thu, 5 Feb 2026 21:43:47 +0800 Subject: [PATCH] fix: delayed piece texture cleanup --- src/game/GameSession.cpp | 1 + src/game/GameTypes.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/GameSession.cpp b/src/game/GameSession.cpp index ee14a57..123f4c4 100644 --- a/src/game/GameSession.cpp +++ b/src/game/GameSession.cpp @@ -100,6 +100,7 @@ bool GameSession::executeAction(int toRow, int toCol) { if (!toPiece) { m_gamePieceEventCallback(GamePieceEvent::MOVE_PIECE, fromRow, fromCol, toRow, toCol); auto fromInfo = fromPiece->getPieceInfo(); + m_gamePieceEventCallback(GamePieceEvent::REMOVE_PIECE, fromRow, fromCol, -1, -1); m_board->removePieceAt(fromRow, fromCol); m_board->placePieceAt(toRow, toCol, m_currentPlayer); m_board->setPieceInfo(toRow, toCol, fromInfo); diff --git a/src/game/GameTypes.h b/src/game/GameTypes.h index fda7dfb..f13b824 100644 --- a/src/game/GameTypes.h +++ b/src/game/GameTypes.h @@ -30,7 +30,7 @@ enum class GameMode { }; enum class GamePieceEvent { - REMOVE_PIECE, + REMOVE_PIECE, // 用于销毁棋子的材质释放内存的 PLACE_PIECE, MOVE_PIECE, GROW_PIECE,