Added terminate() to the MusicEngine and publicized

the iMuse implementation. This allows the termination
sequence to be done BEFORE object destruction, so
that the destructor is not making calls that may not
be appropriate during object destruction. (Virtual
functions were the concern, although I'm not sure any
of that was happening anyway. Oh well, better to be
safe than sorry.)

I implemented an empty terminate() in the base class,
but the other MusicEngine derivatives may have stuff
in their destructors that should be moved to this
method. I didn't check.

svn-id: r10452
This commit is contained in:
Jamieson Christian 2003-09-28 00:03:24 +00:00
parent 1d40ce68c2
commit 044bcd5430
5 changed files with 7 additions and 6 deletions

View file

@ -824,7 +824,10 @@ Scumm::~Scumm () {
delete _confirmExitDialog;
delete _sound;
delete _musicEngine;
if (_musicEngine) {
_musicEngine->terminate();
delete _musicEngine;
}
free(_languageBuffer);
free(_audioNames);