From adb40844d894cd69c4c89fbaddb130a70cab6816 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 20 Jun 2011 21:42:30 +1000 Subject: TSAGE: Bugfix for crash when exiting whilst a sound is playing --- engines/tsage/sound.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'engines') 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::iterator i = _soundList.begin(); i != _soundList.end(); ++i) - (*i)->stop(); + for (Common::List::iterator i = _soundList.begin(); i != _soundList.end(); ) { + Sound *s = *i; + ++i; + s->stop(); + } for (Common::List::iterator i = _installedDrivers.begin(); i != _installedDrivers.end(); ) { SoundDriver *driver = *i; ++i; -- cgit v1.2.3