From 4d6d64837f7f9c29fcbb871084ca878c8be36afc Mon Sep 17 00:00:00 2001 From: Andrii Danylchenko Date: Sun, 29 Oct 2023 09:41:22 +0200 Subject: [PATCH 1/2] #2993 - destruct battle info first when destruction CGameState --- lib/gameState/CGameState.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/gameState/CGameState.cpp b/lib/gameState/CGameState.cpp index c349e851d..2a8ed2955 100644 --- a/lib/gameState/CGameState.cpp +++ b/lib/gameState/CGameState.cpp @@ -409,6 +409,7 @@ CGameState::CGameState() CGameState::~CGameState() { + currentBattles.clear(); map.dellNull(); } From 25b64dd08b9d8a6e5064f3ea4f579f25b9e302dd Mon Sep 17 00:00:00 2001 From: Andrii Danylchenko Date: Tue, 31 Oct 2023 21:43:06 +0200 Subject: [PATCH 2/2] Update lib/gameState/CGameState.cpp Co-authored-by: Ivan Savenko --- lib/gameState/CGameState.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/gameState/CGameState.cpp b/lib/gameState/CGameState.cpp index 2a8ed2955..2b54a9063 100644 --- a/lib/gameState/CGameState.cpp +++ b/lib/gameState/CGameState.cpp @@ -409,6 +409,7 @@ CGameState::CGameState() CGameState::~CGameState() { + // explicitly delete all ongoing battles first - BattleInfo destructor requires valid CGameState currentBattles.clear(); map.dellNull(); }