diff options
author | Andre Heider | 2009-08-24 22:41:56 +0000 |
---|---|---|
committer | Andre Heider | 2009-08-24 22:41:56 +0000 |
commit | e98c7911064232cfe6715ce5e9f61dee88a3659b (patch) | |
tree | 62852a2c4f92c7c31d743fbbcfcd76559c6c925a /engines | |
parent | 081fa85b140b3175f035a74a4fcced59539fea1d (diff) | |
download | scummvm-rg350-e98c7911064232cfe6715ce5e9f61dee88a3659b.tar.gz scummvm-rg350-e98c7911064232cfe6715ce5e9f61dee88a3659b.tar.bz2 scummvm-rg350-e98c7911064232cfe6715ce5e9f61dee88a3659b.zip |
Fixed iMuse regression: IMuseInternal::terminate() was never called, because the base class does not have that virtual function anymore. Code moved to the destructor.
svn-id: r43714
Diffstat (limited to 'engines')
-rw-r--r-- | engines/scumm/imuse/imuse.cpp | 60 | ||||
-rw-r--r-- | engines/scumm/imuse/imuse_internal.h | 3 |
2 files changed, 32 insertions, 31 deletions
diff --git a/engines/scumm/imuse/imuse.cpp b/engines/scumm/imuse/imuse.cpp index 455eaac984..409e1140f1 100644 --- a/engines/scumm/imuse/imuse.cpp +++ b/engines/scumm/imuse/imuse.cpp @@ -73,6 +73,36 @@ _snm_trigger_index(0) { memset(_volchan_table,0,sizeof(_volchan_table)); } +IMuseInternal::~IMuseInternal() { + // Do just enough stuff inside the mutex to + // make sure any MIDI timing threads won't + // interrupt us, and then do the rest outside + // the mutex. + { + Common::StackLock lock(_mutex, "IMuseInternal::~IMuseInternal()"); + _initialized = false; + stopAllSounds_internal(); + } + + if (_midi_adlib) { + _midi_adlib->close(); + delete _midi_adlib; + _midi_adlib = 0; + } + + if (_midi_native) { + if (_native_mt32) { + // Reset the MT-32 + _midi_native->sysEx((const byte *) "\x41\x10\x16\x12\x7f\x00\x00\x01\x00", 9); + _system->delayMillis(250); + } + + _midi_native->close(); + delete _midi_native; + _midi_native = 0; + } +} + byte *IMuseInternal::findStartOfSound(int sound) { byte *ptr = NULL; int32 size, pos; @@ -518,36 +548,6 @@ int IMuseInternal::getMusicTimer() const { return best_time; } -void IMuseInternal::terminate() { - // Do just enough stuff inside the mutex to - // make sure any MIDI timing threads won't - // interrupt us, and then do the rest outside - // the mutex. - { - Common::StackLock lock(_mutex, "IMuseInternal::terminate()"); - _initialized = false; - stopAllSounds_internal(); - } - - if (_midi_adlib) { - _midi_adlib->close(); - delete _midi_adlib; - _midi_adlib = 0; - } - - if (_midi_native) { - if (_native_mt32) { - // Reset the MT-32 - _midi_native->sysEx((const byte *) "\x41\x10\x16\x12\x7f\x00\x00\x01\x00", 9); - _system->delayMillis(250); - } - - _midi_native->close(); - delete _midi_native; - _midi_native = 0; - } -} - //////////////////////////////////////// // // Internal versions of the IMuse and diff --git a/engines/scumm/imuse/imuse_internal.h b/engines/scumm/imuse/imuse_internal.h index 7e2bd03211..3ff2432f3e 100644 --- a/engines/scumm/imuse/imuse_internal.h +++ b/engines/scumm/imuse/imuse_internal.h @@ -445,6 +445,8 @@ protected: protected: IMuseInternal(); + virtual ~IMuseInternal(); + int initialize(OSystem *syst, MidiDriver *nativeMidiDriver, MidiDriver *adlibMidiDriver); static void midiTimerCallback(void *data); @@ -526,7 +528,6 @@ public: void stopAllSounds(); int getSoundStatus(int sound) const; int getMusicTimer() const; - void terminate(); public: // Factory function |