diff --git a/client/Client.cpp b/client/Client.cpp index ea887543a..5faedf779 100644 --- a/client/Client.cpp +++ b/client/Client.cpp @@ -191,7 +191,6 @@ void CClient::endGame() removeGUI(); GAME->setMapInstance(nullptr); - gamestate.reset(); logNetwork->info("Deleted mapHandler and gameState."); @@ -200,6 +199,11 @@ void CClient::endGame() battleints.clear(); battleCallbacks.clear(); playerEnvironments.clear(); + + //FIXME: gamestate->currentBattles.clear() will use gamestate. So it shoule be callded before gamestate.reset() + gamestate->currentBattles.clear(); + gamestate.reset(); + logNetwork->info("Deleted playerInts."); logNetwork->info("Client stopped."); }