diff options
author | Johannes Schickel | 2008-05-06 16:57:07 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-05-06 16:57:07 +0000 |
commit | 2976f961fe09c33e350fd8c6b4ccaddad738bf16 (patch) | |
tree | 2881eb7e2756bb8979bf86dd7a28fe4471e18e0f /engines | |
parent | bce56298e69704b0f844ab71e8385a3b43b861b2 (diff) | |
download | scummvm-rg350-2976f961fe09c33e350fd8c6b4ccaddad738bf16.tar.gz scummvm-rg350-2976f961fe09c33e350fd8c6b4ccaddad738bf16.tar.bz2 scummvm-rg350-2976f961fe09c33e350fd8c6b4ccaddad738bf16.zip |
- Fixed some memory leaks in kyra3
- Fixed valgrind warnings in GUI_v2 code
svn-id: r31902
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/gui_v2.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/kyra_hof.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/kyra_mr.cpp | 10 | ||||
-rw-r--r-- | engines/kyra/kyra_v2.cpp | 1 | ||||
-rw-r--r-- | engines/kyra/scene_mr.cpp | 2 |
5 files changed, 12 insertions, 5 deletions
diff --git a/engines/kyra/gui_v2.cpp b/engines/kyra/gui_v2.cpp index d835c4f8d5..0a74d27a99 100644 --- a/engines/kyra/gui_v2.cpp +++ b/engines/kyra/gui_v2.cpp @@ -43,6 +43,8 @@ GUI_v2::GUI_v2(KyraEngine_v2 *vm) : GUI(vm), _vm(vm), _screen(vm->screen_v2()) { _scrollUpFunctor = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::scrollUpButton); _scrollDownFunctor = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::scrollDownButton); _sliderHandlerFunctor = BUTTON_FUNCTOR(GUI_v2, this, &GUI_v2::sliderHandler); + _savegameOffset = 0; + _isDeleteMenu = false; } Button *GUI_v2::addButtonToList(Button *list, Button *newButton) { diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp index c25af91bec..9716c7edc1 100644 --- a/engines/kyra/kyra_hof.cpp +++ b/engines/kyra/kyra_hof.cpp @@ -780,8 +780,6 @@ void KyraEngine_HoF::cleanup() { delete [] _gfxBackUpRect; _gfxBackUpRect = 0; - delete [] _sceneList; _sceneList = 0; - for (int i = 0; i < ARRAYSIZE(_sceneAnimMovie); ++i) { delete _sceneAnimMovie[i]; _sceneAnimMovie[i] = 0; diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp index 61546fc2e7..9aa50637d0 100644 --- a/engines/kyra/kyra_mr.cpp +++ b/engines/kyra/kyra_mr.cpp @@ -140,6 +140,7 @@ KyraEngine_MR::KyraEngine_MR(OSystem *system, const GameFlags &flags) : KyraEngi _menuDirectlyToLoad = false; _optionsFile = 0; _actorFile = 0; + _chatAltFlag = false; } KyraEngine_MR::~KyraEngine_MR() { @@ -152,6 +153,7 @@ KyraEngine_MR::~KyraEngine_MR() { delete[] _cCodeFile; delete[] _scenesFile; delete[] _itemFile; + delete[] _actorFile; delete[] _gamePlayBuffer; delete[] _interface; delete[] _interfaceCommandLine; @@ -165,7 +167,6 @@ KyraEngine_MR::~KyraEngine_MR() { delete[] _gfxBackUpRect; delete[] _paletteOverlay; - delete[] _sceneList; for (ShapeMap::iterator i = _gameShapes.begin(); i != _gameShapes.end(); ++i) { delete[] i->_value; @@ -552,7 +553,6 @@ void KyraEngine_MR::startup() { _stringBuffer = new char[500]; //XXX musicUpdate(0); - _costPalBuffer = new uint8[864]; //XXX allocAnimObjects(1, 16, 50); @@ -672,7 +672,11 @@ void KyraEngine_MR::startup() { void KyraEngine_MR::loadCostPal() { debugC(9, kDebugLevelMain, "KyraEngine_MR::loadCostPal()"); - _costPalBuffer = _res->fileData("_COSTPAL.DAT", 0); + _res->exists("_COSTPAL.DAT", true); + uint32 size = 0; + _costPalBuffer = _res->fileData("_COSTPAL.DAT", &size); + assert(_costPalBuffer); + assert(size == 864); } void KyraEngine_MR::loadShadowShape() { diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index 176f8e4e2f..422984490a 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -76,6 +76,7 @@ KyraEngine_v2::~KyraEngine_v2() { _gameShapes.clear(); delete[] _itemList; + delete[] _sceneList; _emc->unload(&_sceneScriptData); diff --git a/engines/kyra/scene_mr.cpp b/engines/kyra/scene_mr.cpp index 196c87424d..7da0dd9f75 100644 --- a/engines/kyra/scene_mr.cpp +++ b/engines/kyra/scene_mr.cpp @@ -430,6 +430,8 @@ void KyraEngine_MR::initSceneScript(int unk1) { _screen->_curPage = pageBackUp; musicUpdate(0); } + delete stream; + stream = 0; musicUpdate(0); strcpy(filename, scene.filename1); |