aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2014-10-14 21:26:00 -0400
committerFilippos Karapetis2014-10-15 10:00:55 +0300
commit262c7396d0d2c15ac88d73b8d97c5f76e5815e93 (patch)
tree9a8b4c50b811c4b5b61a3abf56b49f02d2ed2d02 /engines
parentb212e2c6ed5060dba5d5d58c8391c32dfb9f354e (diff)
downloadscummvm-rg350-262c7396d0d2c15ac88d73b8d97c5f76e5815e93.tar.gz
scummvm-rg350-262c7396d0d2c15ac88d73b8d97c5f76e5815e93.tar.bz2
scummvm-rg350-262c7396d0d2c15ac88d73b8d97c5f76e5815e93.zip
MADS: Fix to exit game safely when sound driver hasn't been created
Diffstat (limited to 'engines')
-rw-r--r--engines/mads/sound.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/mads/sound.cpp b/engines/mads/sound.cpp
index 9d0d9c8d20..d0aa770a4d 100644
--- a/engines/mads/sound.cpp
+++ b/engines/mads/sound.cpp
@@ -42,9 +42,11 @@ SoundManager::SoundManager(MADSEngine *vm, Audio::Mixer *mixer) {
}
SoundManager::~SoundManager() {
- _driver->stop();
+ if (_driver) {
+ _driver->stop();
+ delete _driver;
+ }
- delete _driver;
delete _opl;
}