- attempt to fix ftpclient error on shutdown shown by nig
This commit is contained in:
parent
d6c5c2ac0e
commit
6acf5e9e67
|
@ -698,10 +698,29 @@ MenuStateConnectedGame::~MenuStateConnectedGame() {
|
|||
|
||||
if(ftpClientThread != NULL) {
|
||||
ftpClientThread->setCallBackObject(NULL);
|
||||
if(ftpClientThread->shutdownAndWait() == true) {
|
||||
ftpClientThread->signalQuit();
|
||||
sleep(0);
|
||||
if(ftpClientThread->canShutdown(true) == true &&
|
||||
ftpClientThread->shutdownAndWait() == true) {
|
||||
delete ftpClientThread;
|
||||
ftpClientThread = NULL;
|
||||
}
|
||||
else {
|
||||
char szBuf[8096]="";
|
||||
snprintf(szBuf,8096,"In [%s::%s %d] Error cannot shutdown ftpClientThread\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
//SystemFlags::OutputDebug(SystemFlags::debugError,szBuf);
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("%s",szBuf);
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"%s",szBuf);
|
||||
|
||||
//publishToMasterserverThread->cleanup();
|
||||
}
|
||||
|
||||
ftpClientThread = NULL;
|
||||
|
||||
// ftpClientThread->setCallBackObject(NULL);
|
||||
// if(ftpClientThread->shutdownAndWait() == true) {
|
||||
// delete ftpClientThread;
|
||||
// ftpClientThread = NULL;
|
||||
// }
|
||||
}
|
||||
|
||||
cleanupMapPreviewTexture();
|
||||
|
@ -1243,10 +1262,29 @@ void MenuStateConnectedGame::mouseClick(int x, int y, MouseButton mouseButton){
|
|||
}
|
||||
else if(buttonCancelDownloads.mouseClick(x,y)) {
|
||||
if(ftpClientThread != NULL && fileFTPProgressList.empty() == false) {
|
||||
|
||||
ftpClientThread->setCallBackObject(NULL);
|
||||
if(ftpClientThread->shutdownAndWait() == true) {
|
||||
ftpClientThread->signalQuit();
|
||||
sleep(0);
|
||||
if(ftpClientThread->canShutdown(true) == true &&
|
||||
ftpClientThread->shutdownAndWait() == true) {
|
||||
delete ftpClientThread;
|
||||
}
|
||||
else {
|
||||
char szBuf[8096]="";
|
||||
snprintf(szBuf,8096,"In [%s::%s %d] Error cannot shutdown ftpClientThread\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
//SystemFlags::OutputDebug(SystemFlags::debugError,szBuf);
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("%s",szBuf);
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"%s",szBuf);
|
||||
|
||||
//publishToMasterserverThread->cleanup();
|
||||
}
|
||||
ftpClientThread = NULL;
|
||||
|
||||
// ftpClientThread->setCallBackObject(NULL);
|
||||
// if(ftpClientThread->shutdownAndWait() == true) {
|
||||
// delete ftpClientThread;
|
||||
// }
|
||||
|
||||
fileFTPProgressList.clear();
|
||||
getMissingMapFromFTPServerInProgress = false;
|
||||
|
@ -2142,11 +2180,30 @@ void MenuStateConnectedGame::returnToJoinMenu() {
|
|||
}
|
||||
|
||||
if(ftpClientThread != NULL) {
|
||||
|
||||
ftpClientThread->setCallBackObject(NULL);
|
||||
if(ftpClientThread->shutdownAndWait() == true) {
|
||||
ftpClientThread->signalQuit();
|
||||
sleep(0);
|
||||
if(ftpClientThread->canShutdown(true) == true &&
|
||||
ftpClientThread->shutdownAndWait() == true) {
|
||||
delete ftpClientThread;
|
||||
ftpClientThread = NULL;
|
||||
}
|
||||
else {
|
||||
char szBuf[8096]="";
|
||||
snprintf(szBuf,8096,"In [%s::%s %d] Error cannot shutdown ftpClientThread\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
//SystemFlags::OutputDebug(SystemFlags::debugError,szBuf);
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("%s",szBuf);
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"%s",szBuf);
|
||||
|
||||
//publishToMasterserverThread->cleanup();
|
||||
}
|
||||
ftpClientThread = NULL;
|
||||
|
||||
// ftpClientThread->setCallBackObject(NULL);
|
||||
// if(ftpClientThread->shutdownAndWait() == true) {
|
||||
// delete ftpClientThread;
|
||||
// ftpClientThread = NULL;
|
||||
// }
|
||||
}
|
||||
|
||||
if(returnMenuInfo == jmSimple) {
|
||||
|
@ -3090,10 +3147,28 @@ void MenuStateConnectedGame::update() {
|
|||
|
||||
if(ftpClientThread != NULL) {
|
||||
ftpClientThread->setCallBackObject(NULL);
|
||||
if(ftpClientThread->shutdownAndWait() == true) {
|
||||
ftpClientThread->signalQuit();
|
||||
sleep(0);
|
||||
if(ftpClientThread->canShutdown(true) == true &&
|
||||
ftpClientThread->shutdownAndWait() == true) {
|
||||
delete ftpClientThread;
|
||||
ftpClientThread = NULL;
|
||||
}
|
||||
else {
|
||||
char szBuf[8096]="";
|
||||
snprintf(szBuf,8096,"In [%s::%s %d] Error cannot shutdown ftpClientThread\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
//SystemFlags::OutputDebug(SystemFlags::debugError,szBuf);
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("%s",szBuf);
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"%s",szBuf);
|
||||
|
||||
//publishToMasterserverThread->cleanup();
|
||||
}
|
||||
ftpClientThread = NULL;
|
||||
|
||||
// ftpClientThread->setCallBackObject(NULL);
|
||||
// if(ftpClientThread->shutdownAndWait() == true) {
|
||||
// delete ftpClientThread;
|
||||
// ftpClientThread = NULL;
|
||||
// }
|
||||
}
|
||||
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
|
|
|
@ -1135,15 +1135,33 @@ void MenuStateMods::cleanUp() {
|
|||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
if(ftpClientThread != NULL) {
|
||||
ftpClientThread->signalQuit();
|
||||
ftpClientThread->setCallBackObject(NULL);
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
if( ftpClientThread->shutdownAndWait() == true) {
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
ftpClientThread->signalQuit();
|
||||
sleep(0);
|
||||
if(ftpClientThread->canShutdown(true) == true &&
|
||||
ftpClientThread->shutdownAndWait() == true) {
|
||||
delete ftpClientThread;
|
||||
}
|
||||
else {
|
||||
char szBuf[8096]="";
|
||||
snprintf(szBuf,8096,"In [%s::%s %d] Error cannot shutdown ftpClientThread\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
//SystemFlags::OutputDebug(SystemFlags::debugError,szBuf);
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("%s",szBuf);
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"%s",szBuf);
|
||||
|
||||
//publishToMasterserverThread->cleanup();
|
||||
}
|
||||
ftpClientThread = NULL;
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
||||
// ftpClientThread->signalQuit();
|
||||
// ftpClientThread->setCallBackObject(NULL);
|
||||
// if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
// if( ftpClientThread->shutdownAndWait() == true) {
|
||||
// if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
// delete ftpClientThread;
|
||||
// }
|
||||
// ftpClientThread = NULL;
|
||||
// if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
}
|
||||
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
|
|
Loading…
Reference in New Issue
Block a user