diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/parallaction/balloons.cpp | 2 | ||||
-rw-r--r-- | engines/parallaction/graphics.cpp | 2 | ||||
-rw-r--r-- | engines/parallaction/gui_br.cpp | 12 | ||||
-rw-r--r-- | engines/parallaction/parallaction.cpp | 5 | ||||
-rw-r--r-- | engines/parallaction/parallaction_br.cpp | 12 |
5 files changed, 23 insertions, 10 deletions
diff --git a/engines/parallaction/balloons.cpp b/engines/parallaction/balloons.cpp index cb80ee75db..eed52298fd 100644 --- a/engines/parallaction/balloons.cpp +++ b/engines/parallaction/balloons.cpp @@ -753,6 +753,8 @@ BalloonManager_br::~BalloonManager_br() { } void Parallaction::setupBalloonManager() { + _balloonMan = 0; + if (getGameType() == GType_Nippon) { _balloonMan = new BalloonManager_ns(_gfx, _dialogueFont); } else diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index 921aa7e913..5d2b571343 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -769,7 +769,7 @@ GfxObj* Gfx::registerBalloon(Frames *frames, const char *text) { void Gfx::freeDialogueObjects() { _items.clear(); - _vm->_balloonMan->reset(); + _vm->_balloonMan->reset(); for (uint i = 0; i < _balloons.size(); i++) { delete _balloons[i]; diff --git a/engines/parallaction/gui_br.cpp b/engines/parallaction/gui_br.cpp index 9422bdc5d6..e2f3bac8e1 100644 --- a/engines/parallaction/gui_br.cpp +++ b/engines/parallaction/gui_br.cpp @@ -159,11 +159,11 @@ class MainMenuInputState_BR : public MenuInputState { int _selection; void cleanup() { - _vm->_system->showMouse(false); - _vm->_gfx->freeDialogueObjects(); + _vm->_gfx->freeDialogueObjects(); for (int i = 0; i < _availItems; i++) { delete _lines[i]; + _lines[i] = 0; } } @@ -185,13 +185,19 @@ class MainMenuInputState_BR : public MenuInputState { public: MainMenuInputState_BR(Parallaction_br *vm, MenuInputHelper *helper) : MenuInputState("mainmenu", helper), _vm(vm) { + memset(_lines, 0, sizeof(_lines)); } + ~MainMenuInputState_BR() { + cleanup(); + } + virtual MenuInputState* run() { int event = _vm->_input->getLastButtonEvent(); if ((event == kMouseLeftUp) && _selection >= 0) { - cleanup(); + _vm->_system->showMouse(false); + cleanup(); performChoice(_options[_selection]); return 0; } diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 1cbfc599ed..315da333d1 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -86,14 +86,15 @@ Parallaction::~Parallaction() { delete _programExec; delete _saveLoad; + cleanupGui(); + _gfx->freeCharacterObjects(); _gfx->freeLocationObjects(); delete _balloonMan; + _balloonMan = 0; destroyInventory(); - cleanupGui(); - delete _localFlagNames; delete _gfx; delete _soundMan; diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index ac68bb084e..a792b073a2 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -100,9 +100,13 @@ Parallaction_br::~Parallaction_br() { freeFonts(); freeCharacter(); + delete _objects; + delete _locationParser; delete _programParser; + _location._animations.remove(_char._ani); + delete _walker; } @@ -141,15 +145,15 @@ Common::Error Parallaction_br::go() { } - void Parallaction_br::freeFonts() { delete _menuFont; - delete _dialogueFont; - _menuFont = 0; + + delete _dialogueFont; _dialogueFont = 0; + + // no need to delete _labelFont, since it is using the same buffer as _menuFont _labelFont = 0; - _introFont = 0; } |