aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction
diff options
context:
space:
mode:
authorNicola Mettifogo2010-04-28 23:11:34 +0000
committerNicola Mettifogo2010-04-28 23:11:34 +0000
commita0d55ca586cd232488ccb7193cdf8787a1b9ab8d (patch)
tree3d74b54d68207f80408fcb8ccbfb57a8176b203f /engines/parallaction
parent4cb1fc9e795d555826e1bd5e06320c329d73f30c (diff)
downloadscummvm-rg350-a0d55ca586cd232488ccb7193cdf8787a1b9ab8d.tar.gz
scummvm-rg350-a0d55ca586cd232488ccb7193cdf8787a1b9ab8d.tar.bz2
scummvm-rg350-a0d55ca586cd232488ccb7193cdf8787a1b9ab8d.zip
Make sure dialogue manager is destroyed on quit.
svn-id: r48847
Diffstat (limited to 'engines/parallaction')
-rw-r--r--engines/parallaction/dialogue.cpp9
-rw-r--r--engines/parallaction/parallaction.cpp4
-rw-r--r--engines/parallaction/parallaction.h1
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();