aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2011-06-20 21:42:30 +1000
committerPaul Gilbert2011-06-20 21:42:30 +1000
commitadb40844d894cd69c4c89fbaddb130a70cab6816 (patch)
tree5793b72bfa362153eb0ea9566d1fcbd3efd9782d /engines
parent7c733a538c5c333041cb35975f215d3b354468ea (diff)
downloadscummvm-rg350-adb40844d894cd69c4c89fbaddb130a70cab6816.tar.gz
scummvm-rg350-adb40844d894cd69c4c89fbaddb130a70cab6816.tar.bz2
scummvm-rg350-adb40844d894cd69c4c89fbaddb130a70cab6816.zip
TSAGE: Bugfix for crash when exiting whilst a sound is playing
Diffstat (limited to 'engines')
-rw-r--r--engines/tsage/sound.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp
index 73eaa5fb2e..51a24a3c86 100644
--- a/engines/tsage/sound.cpp
+++ b/engines/tsage/sound.cpp
@@ -55,8 +55,11 @@ SoundManager::SoundManager() {
SoundManager::~SoundManager() {
if (__sndmgrReady) {
- for (Common::List<Sound *>::iterator i = _soundList.begin(); i != _soundList.end(); ++i)
- (*i)->stop();
+ for (Common::List<Sound *>::iterator i = _soundList.begin(); i != _soundList.end(); ) {
+ Sound *s = *i;
+ ++i;
+ s->stop();
+ }
for (Common::List<SoundDriver *>::iterator i = _installedDrivers.begin(); i != _installedDrivers.end(); ) {
SoundDriver *driver = *i;
++i;