diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gob/gob.cpp | 3 | ||||
-rw-r--r-- | engines/gob/sound.cpp | 8 | ||||
-rw-r--r-- | engines/gob/sound.h | 2 |
3 files changed, 13 insertions, 0 deletions
diff --git a/engines/gob/gob.cpp b/engines/gob/gob.cpp index cbd28bc588..37a6032cd6 100644 --- a/engines/gob/gob.cpp +++ b/engines/gob/gob.cpp @@ -95,6 +95,9 @@ GobEngine::GobEngine(OSystem *syst) : Engine(syst) { } GobEngine::~GobEngine() { + if (_snd) + _snd->terminate(); + delete _mult; delete _game; delete _snd; diff --git a/engines/gob/sound.cpp b/engines/gob/sound.cpp index a213d540b3..fb591d5e36 100644 --- a/engines/gob/sound.cpp +++ b/engines/gob/sound.cpp @@ -129,6 +129,14 @@ Snd::Snd(GobEngine *vm) : _vm(vm) { &_speakerStream, -1, 255, 0, false, true); } +void Snd::terminate() { + // stop permanent streams manually + _vm->_mixer->stopHandle(_handle); + _vm->_mixer->stopHandle(_speakerHandle); + + _vm->_mixer->stopAll(); +} + void Snd::setBlasterPort(int16 port) {return;} void Snd::speakerOn(int16 frequency, int32 length) { diff --git a/engines/gob/sound.h b/engines/gob/sound.h index 8d7ffd7b8d..4628820ad8 100644 --- a/engines/gob/sound.h +++ b/engines/gob/sound.h @@ -49,6 +49,8 @@ public: CleanupFuncPtr _cleanupFunc; Snd(GobEngine *vm); + + void terminate(); void speakerOn(int16 frequency, int32 length); void speakerOff(void); void speakerOnUpdate(uint32 milis); |