1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

Fixed several assertion failures on shutting down game

This commit is contained in:
Ivan Savenko
2022-12-16 16:19:57 +02:00
parent 291bb9b204
commit 4d628a8ba1
3 changed files with 43 additions and 40 deletions

View File

@@ -377,26 +377,18 @@ void CClient::endGame()
i.second->finish();
GH.curInt = nullptr;
{
boost::unique_lock<boost::recursive_mutex> un(*CPlayerInterface::pim);
logNetwork->info("Ending current game!");
if(GH.topInt())
{
GH.topInt()->deactivate();
}
GH.listInt.clear();
GH.objsToBlit.clear();
GH.statusbar = nullptr;
logNetwork->info("Removed GUI.");
vstd::clear_pointer(const_cast<CGameInfo *>(CGI)->mh);
vstd::clear_pointer(gs);
logNetwork->info("Deleted mapHandler and gameState.");
LOCPLINT = nullptr;
}
playerint.clear();
{
boost::unique_lock<boost::recursive_mutex> un(*CPlayerInterface::pim);
logNetwork->info("Ending current game!");
removeGUI();
vstd::clear_pointer(const_cast<CGameInfo *>(CGI)->mh);
vstd::clear_pointer(gs);
logNetwork->info("Deleted mapHandler and gameState.");
}
playerint.clear();
battleints.clear();
battleCallbacks.clear();
playerEnvironments.clear();