From b19a6d8574e3d79540644f1c80d17ed82b955ce1 Mon Sep 17 00:00:00 2001 From: Jamieson Christian Date: Mon, 26 May 2003 14:51:13 +0000 Subject: [PATCH] Fixes possible crashes during music shutdown svn-id: r8009 --- scumm/imuse.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp index 6e1272b1880..0b499f37641 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;