- fixed a memory leak and fixed a segfault in a thread class

This commit is contained in:
Mark Vejvoda 2012-04-16 15:46:22 +00:00
parent a37dc8a7b3
commit 1403a3fe44
2 changed files with 6 additions and 3 deletions

View File

@ -387,6 +387,7 @@ void CoreData::load() {
menuMusic.open(getGameCustomCoreDataPath(data_path, "data/core/" + menuMusicPath + menuMusicFile));
menuMusic.setNext(&menuMusic);
cleanup();
waterSounds.resize(6);
for(int i=0; i<6; ++i){

View File

@ -412,17 +412,19 @@ void SimpleTaskThread::execute() {
sleep(this->millisecsBetweenExecutions);
}
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] uniqueID [%s]\n",__FILE__,__FUNCTION__,__LINE__,this->getUniqueID().c_str());
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] uniqueID [%s] END\n",__FILE__,__FUNCTION__,__LINE__,this->getUniqueID().c_str());
mustDeleteSelf = getDeleteSelfOnExecutionDone();
}
catch(const exception &ex) {
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] Error [%s]\n",__FILE__,__FUNCTION__,__LINE__,ex.what());
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] uniqueID [%s]\n",__FILE__,__FUNCTION__,__LINE__,this->getUniqueID().c_str());
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] uniqueID [%s] END\n",__FILE__,__FUNCTION__,__LINE__,this->getUniqueID().c_str());
mustDeleteSelf = getDeleteSelfOnExecutionDone();
throw megaglest_runtime_error(ex.what());
}
}
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] uniqueID [%s] END\n",__FILE__,__FUNCTION__,__LINE__,this->getUniqueID().c_str());
mustDeleteSelf = getDeleteSelfOnExecutionDone();
}
if(mustDeleteSelf == true) {