Browse Source

Merge pull request #3122 from vcmi/fix-2993

#2993 - destruct battle info first when destructing CGameState
Andrii Danylchenko 2 years ago
parent
commit
caffc8f3cd
1 changed files with 2 additions and 0 deletions
  1. 2 0
      lib/gameState/CGameState.cpp

+ 2 - 0
lib/gameState/CGameState.cpp

@@ -409,6 +409,8 @@ CGameState::CGameState()
 
 
 CGameState::~CGameState()
 CGameState::~CGameState()
 {
 {
+	// explicitly delete all ongoing battles first - BattleInfo destructor requires valid CGameState
+	currentBattles.clear();
 	map.dellNull();
 	map.dellNull();
 }
 }