From 328dc19f1d82e515c3d85b1fa82545e571b06bf7 Mon Sep 17 00:00:00 2001 From: Albert Zeyer Date: Mon, 16 Nov 2009 14:36:46 +0100 Subject: [PATCH] small fix: always reset vars after deletion --- src/CGame.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/CGame.cpp b/src/CGame.cpp index b289ee2ea..8fd291ad5 100644 --- a/src/CGame.cpp +++ b/src/CGame.cpp @@ -243,21 +243,21 @@ bool CGame::loadResources(unsigned short Episode, const std::string& DataDirecto // Patch the EXE-File-Data directly in the memory. CPatcher *Patcher = new CPatcher(Episode, ExeFile->getEXEVersion(), ExeFile->getData(), DataDirectory); Patcher->patchMemory(); - delete Patcher; + delete Patcher; Patcher = NULL; // Load tile attributes. - if(TileLoader) delete TileLoader; + if(TileLoader) delete TileLoader; TileLoader = NULL; if(ExeFile->getData() == NULL) { g_pLogFile->textOut(RED, "CGame::loadResources: Could not load data out of EXE
"); - delete ExeFile; + delete ExeFile; ExeFile = NULL; return false; } TileLoader = new CTileLoader(Episode, ExeFile->getEXEVersion(), ExeFile->getData()); if(!TileLoader->load()) { g_pLogFile->textOut(RED, "CGame::loadResources: Could not load data with TileLoader
"); - delete ExeFile; + delete ExeFile; ExeFile = NULL; return false; } @@ -266,7 +266,7 @@ bool CGame::loadResources(unsigned short Episode, const std::string& DataDirecto //m_Messages->readData(char *buf, int episode, int version); loadstrings("strings.dat"); - delete ExeFile; + delete ExeFile; ExeFile = NULL; // Load the sound data bool ok = g_pSound->loadSoundData(m_Episode, DataDirectory);