diff options
Diffstat (limited to 'engines/parallaction')
-rw-r--r-- | engines/parallaction/dialogue.cpp | 9 | ||||
-rw-r--r-- | engines/parallaction/parallaction.cpp | 4 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 1 |
3 files changed, 11 insertions, 3 deletions
diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp index ee877ce98e..284b74cacc 100644 --- a/engines/parallaction/dialogue.cpp +++ b/engines/parallaction/dialogue.cpp @@ -485,8 +485,7 @@ void Parallaction::exitDialogueMode() { ZonePtr z = _dialogueMan->_z; // destroy the _dialogueMan here - delete _dialogueMan; - _dialogueMan = 0; + destroyDialogueManager(); // run the lists saved if (_cmdList) { @@ -495,6 +494,12 @@ void Parallaction::exitDialogueMode() { _cmdExec->run(z->_commands, z); } +void Parallaction::destroyDialogueManager() { + // destroy the _dialogueMan here + delete _dialogueMan; + _dialogueMan = 0; +} + void Parallaction::runDialogueFrame() { if (_input->_inputMode != Input::kInputModeDialogue) { return; diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 885c01fccc..a529c7fb46 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -57,7 +57,8 @@ uint32 _globalFlags = 0; Parallaction::Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gameDesc) : - Engine(syst), _gameDescription(gameDesc), _location(getGameType()) { + Engine(syst), _gameDescription(gameDesc), _location(getGameType()), + _dialogueMan(0) { _vm = this; DebugMan.addDebugChannel(kDebugDialogue, "dialogue", "Dialogues debug level"); @@ -81,6 +82,7 @@ Parallaction::~Parallaction() { delete _callableNames; delete _cmdExec; delete _programExec; + destroyDialogueManager(); delete _saveLoad; cleanupGui(); diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index 52ea0c62ec..a5769350bd 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -341,6 +341,7 @@ protected: void allocateLocationSlot(const char *name); void finalizeLocationParsing(); void showLocationComment(const Common::String &text, bool end); + void destroyDialogueManager(); public: void beep(); |