some memory leak cleanup

This commit is contained in:
Mark Vejvoda
2013-11-13 21:22:56 +00:00
parent 2d8f0f7430
commit 4e1c9be664
6 changed files with 32 additions and 62 deletions

View File

@@ -685,6 +685,7 @@ void Font::bidi_cvt(string &str_) {
//Free allocated memory
delete [] ltov;
delete [] vtol;
delete [] visual;
delete [] logical;
delete [] ip;

View File

@@ -34,6 +34,7 @@ FileCRCPreCacheThread::FileCRCPreCacheThread() : BaseThread() {
workerThreadTechPaths.clear();
preCacheWorkerThreadList.clear();
processTechCB = NULL;
pauseForGame = false;
uniqueID = "FileCRCPreCacheThread";
}
@@ -44,6 +45,7 @@ FileCRCPreCacheThread::FileCRCPreCacheThread(vector<string> techDataPaths,
this->workerThreadTechPaths = workerThreadTechPaths;
preCacheWorkerThreadList.clear();
this->processTechCB = processTechCB;
pauseForGame = false;
uniqueID = "FileCRCPreCacheThread";
}

View File

@@ -400,6 +400,10 @@ XmlNode *XmlIoRapid::load(const string &path, const std::map<string,string> &map
rootNode= new XmlNode(doc->first_node(),mapTagReplacementValues);
//doc->clear();
cleanup();
init();
if(showPerfStats) printf("In [%s::%s Line: %d] took msecs: " MG_I64_SPECIFIER "\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis());
#if defined(WIN32) && !defined(__MINGW32__)