diff options
author | Filippos Karapetis | 2010-01-19 17:34:24 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-01-19 17:34:24 +0000 |
commit | 54638f005b4232511a4d9417bf6c53ca28330b92 (patch) | |
tree | a4dc038847c1953efba43148f3c85f233a9761f0 /engines/sci/sound | |
parent | d17e80f2147fcf9f70ac4ac6bf223abfbae0b306 (diff) | |
download | scummvm-rg350-54638f005b4232511a4d9417bf6c53ca28330b92.tar.gz scummvm-rg350-54638f005b4232511a4d9417bf6c53ca28330b92.tar.bz2 scummvm-rg350-54638f005b4232511a4d9417bf6c53ca28330b92.zip |
Delete the inner music driver when MidiPlayer_AdLib() is destroyed, not in close(), as MidiPlayer_AdLib() is closed and reopened inside SciMusic::resetDriver(). Fixes savegame loading and resetting the game
svn-id: r47384
Diffstat (limited to 'engines/sci/sound')
-rw-r--r-- | engines/sci/sound/music.cpp | 2 | ||||
-rw-r--r-- | engines/sci/sound/softseq/adlib.cpp | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp index 5a5e5c877e..32b311cd63 100644 --- a/engines/sci/sound/music.cpp +++ b/engines/sci/sound/music.cpp @@ -146,6 +146,8 @@ void SciMusic::setReverb(byte reverb) { void SciMusic::resetDriver() { Common::StackLock lock(_mutex); + // TODO/FIXME: is there any better way to reset the driver? + _pMidiDrv->close(); _pMidiDrv->open(); _pMidiDrv->setTimerCallback(this, &miditimerCallback); diff --git a/engines/sci/sound/softseq/adlib.cpp b/engines/sci/sound/softseq/adlib.cpp index 4674cb5e33..9534b5bad0 100644 --- a/engines/sci/sound/softseq/adlib.cpp +++ b/engines/sci/sound/softseq/adlib.cpp @@ -161,7 +161,10 @@ private: class MidiPlayer_AdLib : public MidiPlayer { public: MidiPlayer_AdLib() { _driver = new MidiDriver_AdLib(g_system->getMixer()); } - ~MidiPlayer_AdLib() {} + ~MidiPlayer_AdLib() { + delete _driver; + _driver = 0; + } int open(ResourceManager *resMan); void close(); @@ -817,8 +820,6 @@ int MidiPlayer_AdLib::open(ResourceManager *resMan) { void MidiPlayer_AdLib::close() { if (_driver) { _driver->close(); - delete _driver; - _driver = 0; } } |