diff options
Diffstat (limited to 'engines/parallaction/gui_br.cpp')
-rw-r--r-- | engines/parallaction/gui_br.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
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; } |