aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2007-02-26 18:52:28 +0000
committerWillem Jan Palenstijn2007-02-26 18:52:28 +0000
commitb1a12658b05f77edf2c4b03c82b3f04e1255b35f (patch)
tree7ba6bdcd76b52c231c7deffd1b5414267796b56a /engines
parent1af4932242e637123099512e1aed80181a423687 (diff)
downloadscummvm-rg350-b1a12658b05f77edf2c4b03c82b3f04e1255b35f.tar.gz
scummvm-rg350-b1a12658b05f77edf2c4b03c82b3f04e1255b35f.tar.bz2
scummvm-rg350-b1a12658b05f77edf2c4b03c82b3f04e1255b35f.zip
stop audio streams before deleting them
svn-id: r25882
Diffstat (limited to 'engines')
-rw-r--r--engines/gob/gob.cpp3
-rw-r--r--engines/gob/sound.cpp8
-rw-r--r--engines/gob/sound.h2
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);