From b1a12658b05f77edf2c4b03c82b3f04e1255b35f Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 26 Feb 2007 18:52:28 +0000 Subject: stop audio streams before deleting them svn-id: r25882 --- engines/gob/gob.cpp | 3 +++ engines/gob/sound.cpp | 8 ++++++++ engines/gob/sound.h | 2 ++ 3 files changed, 13 insertions(+) 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); -- cgit v1.2.3