From 0926f1e7476fd7096c5471f354869d1840eb2210 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Mon, 15 Oct 2012 23:10:41 +0000 Subject: [PATCH] - forgot to delete the masterserver connection --- .../menu/menu_state_connected_game.cpp | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/source/glest_game/menu/menu_state_connected_game.cpp b/source/glest_game/menu/menu_state_connected_game.cpp index 4b88b922..1a36eaf0 100644 --- a/source/glest_game/menu/menu_state_connected_game.cpp +++ b/source/glest_game/menu/menu_state_connected_game.cpp @@ -669,6 +669,22 @@ void MenuStateConnectedGame::reloadUI() { } MenuStateConnectedGame::~MenuStateConnectedGame() { + if(modHttpServerThread != NULL) { + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__); + if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__); + modHttpServerThread->signalQuit(); + //modHttpServerThread->setThreadOwnerValid(false); + + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__); + if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__); + if( modHttpServerThread->canShutdown(true) == true && + modHttpServerThread->shutdownAndWait() == true) { + delete modHttpServerThread; + } + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__); + modHttpServerThread = NULL; + } + if(ftpClientThread != NULL) { ftpClientThread->setCallBackObject(NULL); if(ftpClientThread->shutdownAndWait() == true) { @@ -2083,6 +2099,22 @@ void MenuStateConnectedGame::loadGameSettings(GameSettings *gameSettings) { void MenuStateConnectedGame::returnToJoinMenu() { if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); + if(modHttpServerThread != NULL) { + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__); + if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__); + modHttpServerThread->signalQuit(); + //modHttpServerThread->setThreadOwnerValid(false); + + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__); + if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__); + if( modHttpServerThread->canShutdown(true) == true && + modHttpServerThread->shutdownAndWait() == true) { + delete modHttpServerThread; + } + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__); + modHttpServerThread = NULL; + } + if(ftpClientThread != NULL) { ftpClientThread->setCallBackObject(NULL); if(ftpClientThread->shutdownAndWait() == true) { @@ -3027,6 +3059,22 @@ void MenuStateConnectedGame::update() { if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); + if(modHttpServerThread != NULL) { + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__); + if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__); + modHttpServerThread->signalQuit(); + //modHttpServerThread->setThreadOwnerValid(false); + + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__); + if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__); + if( modHttpServerThread->canShutdown(true) == true && + modHttpServerThread->shutdownAndWait() == true) { + delete modHttpServerThread; + } + if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__); + modHttpServerThread = NULL; + } + if(ftpClientThread != NULL) { ftpClientThread->setCallBackObject(NULL); if(ftpClientThread->shutdownAndWait() == true) {