diff options
-rw-r--r-- | sound/midiparser.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/midiparser.cpp b/sound/midiparser.cpp index 7d09f4ec0d..2528399994 100644 --- a/sound/midiparser.cpp +++ b/sound/midiparser.cpp @@ -407,6 +407,11 @@ bool MidiParser::jumpToTick(uint32 tick, bool fireEvents) { } void MidiParser::unloadMusic() { + if (_driver) { + // Detach the player callback handler, to prevent it from + // being called while the music is being unloaded + _driver->setTimerCallback(NULL, NULL); + } resetTracking(); allNotesOff(); _num_tracks = 0; |