mirror of
https://github.com/glest/glest-source.git
synced 2025-02-25 12:12:25 +01:00
attempt to fix titi's segfault when reloading and exiting custom menu
This commit is contained in:
parent
ed00d9ad8b
commit
462524bcae
@ -939,11 +939,13 @@ void MenuStateCustomGame::cleanup() {
|
||||
if(forceWaitForShutdown == true) {
|
||||
time_t elapsed = time(NULL);
|
||||
publishToMasterserverThread->signalQuit();
|
||||
for(;publishToMasterserverThread->canShutdown(false) == false &&
|
||||
for(;(publishToMasterserverThread->canShutdown(false) == false ||
|
||||
publishToMasterserverThread->getRunningStatus() == true) &&
|
||||
difftime((long int)time(NULL),elapsed) <= 15;) {
|
||||
//sleep(150);
|
||||
}
|
||||
if(publishToMasterserverThread->canShutdown(true)) {
|
||||
if(publishToMasterserverThread->canShutdown(true) == true &&
|
||||
publishToMasterserverThread->getRunningStatus() == false) {
|
||||
delete publishToMasterserverThread;
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||
}
|
||||
@ -955,6 +957,9 @@ void MenuStateCustomGame::cleanup() {
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"%s",szBuf);
|
||||
|
||||
publishToMasterserverThread->setOverrideShutdownTask(shutdownTaskStatic);
|
||||
publishToMasterserverThread->setDeleteSelfOnExecutionDone(true);
|
||||
publishToMasterserverThread->setDeleteAfterExecute(true);
|
||||
|
||||
//publishToMasterserverThread->cleanup();
|
||||
}
|
||||
publishToMasterserverThread = NULL;
|
||||
@ -963,7 +968,7 @@ void MenuStateCustomGame::cleanup() {
|
||||
publishToMasterserverThread->signalQuit();
|
||||
sleep(0);
|
||||
if(publishToMasterserverThread->canShutdown(true) == true &&
|
||||
publishToMasterserverThread->shutdownAndWait() == true) {
|
||||
publishToMasterserverThread->getRunningStatus() == false) {
|
||||
delete publishToMasterserverThread;
|
||||
}
|
||||
else {
|
||||
@ -974,6 +979,8 @@ void MenuStateCustomGame::cleanup() {
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"%s",szBuf);
|
||||
|
||||
publishToMasterserverThread->setOverrideShutdownTask(shutdownTaskStatic);
|
||||
publishToMasterserverThread->setDeleteSelfOnExecutionDone(true);
|
||||
publishToMasterserverThread->setDeleteAfterExecute(true);
|
||||
//publishToMasterserverThread->cleanup();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user