aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamieson Christian2003-05-26 14:51:13 +0000
committerJamieson Christian2003-05-26 14:51:13 +0000
commitb19a6d8574e3d79540644f1c80d17ed82b955ce1 (patch)
tree59ac2d1fef6ba763ba30b36e4713a005bf44ed43
parentdce77eb79bd2ea7b0cb5e2b05b5cbfd18b7e1ce2 (diff)
downloadscummvm-rg350-b19a6d8574e3d79540644f1c80d17ed82b955ce1.tar.gz
scummvm-rg350-b19a6d8574e3d79540644f1c80d17ed82b955ce1.tar.bz2
scummvm-rg350-b19a6d8574e3d79540644f1c80d17ed82b955ce1.zip
Fixes possible crashes during music shutdown
svn-id: r8009
-rw-r--r--scumm/imuse.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp
index 6e1272b188..0b499f3764 100644
--- a/scumm/imuse.cpp
+++ b/scumm/imuse.cpp
@@ -595,6 +595,13 @@ int IMuseInternal::get_master_volume() {
}
int IMuseInternal::terminate() {
+ // We are going to remove the MIDI drivers,
+ // so first pull any reference to them by
+ // the parts.
+ int i;
+ for (i = 0; i < ARRAYSIZE(_parts); ++i)
+ _parts[i]._mc = 0;
+
if (_midi_adlib) {
_midi_adlib->close();
delete _midi_adlib;