diff options
author | Johannes Schickel | 2008-05-06 17:30:31 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-05-06 17:30:31 +0000 |
commit | 2ee01bf757ace2cf24835c34baa18ce6711bea54 (patch) | |
tree | 80e690f5f057ccd00f386407b3f66829da3e88a2 /engines/kyra | |
parent | 2976f961fe09c33e350fd8c6b4ccaddad738bf16 (diff) | |
download | scummvm-rg350-2ee01bf757ace2cf24835c34baa18ce6711bea54.tar.gz scummvm-rg350-2ee01bf757ace2cf24835c34baa18ce6711bea54.tar.bz2 scummvm-rg350-2ee01bf757ace2cf24835c34baa18ce6711bea54.zip |
- Fixed valgrind warnings in HoF
- Fixed memory leaks in HoF
svn-id: r31903
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/kyra_hof.cpp | 8 | ||||
-rw-r--r-- | engines/kyra/sequences_hof.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/staticres.cpp | 3 |
3 files changed, 9 insertions, 4 deletions
diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp index 9716c7edc1..f400173cb0 100644 --- a/engines/kyra/kyra_hof.cpp +++ b/engines/kyra/kyra_hof.cpp @@ -140,6 +140,8 @@ KyraEngine_HoF::KyraEngine_HoF(OSystem *system, const GameFlags &flags) : KyraEn _menuDirectlyToLoad = false; _menu = 0; + _chatIsNote = false; + memset(&_npcScriptData, 0, sizeof(_npcScriptData)); } KyraEngine_HoF::~KyraEngine_HoF() { @@ -792,6 +794,8 @@ void KyraEngine_HoF::cleanup() { delete [] _buttonShapes[i]; _buttonShapes[i] = 0; } + + _emc->unload(&_npcScriptData); } #pragma mark - Localization @@ -1006,7 +1010,7 @@ void KyraEngine_HoF::loadMouseShapes() { _screen->loadBitmap("_MOUSE.CSH", 3, 3, 0); for (int i = 0; i <= 8; ++i) - addShapeToPool(_screen->makeShapeCopy(_screen->getCPagePtr(3), i), i); + addShapeToPool(_screen->getCPagePtr(3), i, i); } void KyraEngine_HoF::loadItemShapes() { @@ -1068,6 +1072,8 @@ void KyraEngine_HoF::runStartScript(int script, int unk1) { } void KyraEngine_HoF::loadNPCScript() { + _emc->unload(&_npcScriptData); + char filename[12]; strcpy(filename, "_NPC.EMC"); diff --git a/engines/kyra/sequences_hof.cpp b/engines/kyra/sequences_hof.cpp index 1c74f48990..050b00c878 100644 --- a/engines/kyra/sequences_hof.cpp +++ b/engines/kyra/sequences_hof.cpp @@ -2665,8 +2665,6 @@ void KyraEngine_HoF::seq_uninit() { if (_flags.isDemo && !_flags.isTalkie) _staticres->unloadId(k2SeqplayShapeAnimData); - _gameShapes.clear(); - delete _menu; _menu = 0; } diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp index 16d7ca4d9b..c9d81cc92a 100644 --- a/engines/kyra/staticres.cpp +++ b/engines/kyra/staticres.cpp @@ -831,7 +831,8 @@ void StaticResource::freeRawData(void *&ptr, int &size) { void StaticResource::freeStringTable(void *&ptr, int &size) { char **data = (char**)ptr; while (size--) - delete [] data[size]; + delete[] data[size]; + delete[] data; ptr = 0; size = 0; } |