mirror of
https://github.com/glest/glest-source.git
synced 2025-08-30 11:19:48 +02:00
- bugfix for segfault in menu when exiting too fast
This commit is contained in:
@@ -296,6 +296,8 @@ SimpleTaskThread::SimpleTaskThread( SimpleTaskCallbackInterface *simpleTaskInter
|
||||
this->executionCount = executionCount;
|
||||
this->millisecsBetweenExecutions = millisecsBetweenExecutions;
|
||||
this->needTaskSignal = needTaskSignal;
|
||||
this->overrideShutdownTask = NULL;
|
||||
|
||||
setTaskSignalled(false);
|
||||
|
||||
static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
|
||||
@@ -308,10 +310,7 @@ SimpleTaskThread::SimpleTaskThread( SimpleTaskCallbackInterface *simpleTaskInter
|
||||
|
||||
SimpleTaskThread::~SimpleTaskThread() {
|
||||
try {
|
||||
if(this->simpleTaskInterface != NULL) {
|
||||
this->simpleTaskInterface->shutdownTask(this);
|
||||
this->simpleTaskInterface = NULL;
|
||||
}
|
||||
cleanup();
|
||||
}
|
||||
catch(const exception &ex) {
|
||||
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] Error [%s]\n",__FILE__,__FUNCTION__,__LINE__,ex.what());
|
||||
@@ -322,6 +321,21 @@ SimpleTaskThread::~SimpleTaskThread() {
|
||||
}
|
||||
}
|
||||
|
||||
void SimpleTaskThread::cleanup() {
|
||||
if(this->overrideShutdownTask != NULL) {
|
||||
this->overrideShutdownTask(this);
|
||||
this->overrideShutdownTask = NULL;
|
||||
}
|
||||
else if(this->simpleTaskInterface != NULL) {
|
||||
this->simpleTaskInterface->shutdownTask(this);
|
||||
this->simpleTaskInterface = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void SimpleTaskThread::setOverrideShutdownTask(taskFunctionCallback *ptr) {
|
||||
this->overrideShutdownTask = ptr;
|
||||
}
|
||||
|
||||
bool SimpleTaskThread::isThreadExecutionLagging() {
|
||||
bool result = false;
|
||||
static string mutexOwnerId = string(__FILE__) + string("_") + intToStr(__LINE__);
|
||||
|
@@ -155,6 +155,9 @@ std::string SystemFlags::getHTTP(std::string URL,CURL *handle,int timeOut,CURLco
|
||||
|
||||
/* get contents from the URL */
|
||||
CURLcode result = curl_easy_perform(handle);
|
||||
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("CURL result = %d\n",result);
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("CURL errbuf [%s]\n",errbuf);
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line %d] return code [%d] [%s]\n",__FILE__,__FUNCTION__,__LINE__,result,errbuf);
|
||||
|
||||
std::string serverResponse = (chunk.memory != NULL ? chunk.memory : "");
|
||||
|
Reference in New Issue
Block a user