From 78f54ffcd39742c4c7060728994db03005b7d230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20W=2E=20Urba=C5=84czyk?= Date: Sat, 13 Feb 2010 21:45:46 +0000 Subject: [PATCH] Fixed game loading. Release 0.75d --- client/CPreGame.cpp | 1 + client/Client.cpp | 10 ++++++++-- client/GUIClasses.cpp | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/client/CPreGame.cpp b/client/CPreGame.cpp index 812f46b2a..41c0d7b93 100644 --- a/client/CPreGame.cpp +++ b/client/CPreGame.cpp @@ -570,6 +570,7 @@ void SelectionTab::parseGames(std::vector &files) tlog1 << files[i].name << " is not a correct savefile!" << std::endl; continue; } + allItems[i].mapHeader = new CMapHeader(); lf >> *(allItems[i].mapHeader) >> allItems[i].seldiff; allItems[i].filename = files[i].name; allItems[i].countPlayers(); diff --git a/client/Client.cpp b/client/Client.cpp index d73135f63..f891d5eca 100644 --- a/client/Client.cpp +++ b/client/Client.cpp @@ -175,6 +175,7 @@ void CClient::stop() LOCPLINT->terminate_cond.setn(true); LOCPLINT->pim->lock(); endGame(); + tlog0 << "Client stopped." << std::endl; } void CClient::save(const std::string & fname) @@ -195,12 +196,14 @@ void CClient::endGame() GH.topInt()->deactivate(); GH.listInt.clear(); GH.objsToBlit.clear(); + tlog0 << "Removed GUI." << std::endl; delete CGI->mh; CGI->mh = NULL; delete CGI->state; CGI->state = NULL; + tlog0 << "Deleted mapHandler and gameState." << std::endl; LOCPLINT = NULL; while (!playerint.empty()) @@ -213,13 +216,14 @@ void CClient::endGame() { delete cb; } + tlog0 << "Deleted playerInts." << std::endl; if (serv) { - tlog3 << "Connection has been requested to be closed.\n"; + tlog0 << "Connection has been requested to be closed.\n"; boost::unique_lock(*serv->wmx); *serv << &CloseServer(); - tlog3 << "Sent closing signal to the server\n"; + tlog0 << "Sent closing signal to the server\n"; serv->close(); delete serv; @@ -228,6 +232,8 @@ void CClient::endGame() } connectionHandler->join(); + tlog0 << "Connection handler thread joined" << std::endl; + delete connectionHandler; connectionHandler = NULL; } diff --git a/client/GUIClasses.cpp b/client/GUIClasses.cpp index c46f79a6e..1b0f6b32a 100644 --- a/client/GUIClasses.cpp +++ b/client/GUIClasses.cpp @@ -5065,4 +5065,4 @@ void MoraleLuckBox::set( bool morale, const CGHeroInstance *hero, int slot /*= - for(int it=0; it < mrl.size(); it++) text += "\n" + mrl[it].second; } -} +}