From f83a32464c99f577ad5ef13198d95a0ee1709037 Mon Sep 17 00:00:00 2001 From: Jamieson Christian Date: Wed, 18 Jun 2003 22:46:17 +0000 Subject: [PATCH] Fix for bug [756555] ALL: With '-ewindows' notes don't stop at quit and bug [755176] SIMON2: Hanging notes More cleanup of the thread issues associated with iMuse and MidiParser shutdown. Untested. svn-id: r8546 --- scumm/imuse.cpp | 7 +------ sound/midiparser.h | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp index 7a0d244273a..ebb5983931e 100644 --- a/scumm/imuse.cpp +++ b/scumm/imuse.cpp @@ -594,12 +594,7 @@ 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; + stop_all_sounds(); if (_midi_adlib) { _midi_adlib->close(); diff --git a/sound/midiparser.h b/sound/midiparser.h index 5e5bb6ca49a..4ac4a69746c 100644 --- a/sound/midiparser.h +++ b/sound/midiparser.h @@ -234,7 +234,7 @@ public: public: MidiParser(); - virtual ~MidiParser() { } + virtual ~MidiParser() { allNotesOff(); } virtual bool loadMusic (byte *data, uint32 size) = 0; virtual void unloadMusic();