aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2007-08-22 12:20:21 +0000
committerFilippos Karapetis2007-08-22 12:20:21 +0000
commit532c8c4230f6e9dcea58642094b893da0f0f75a5 (patch)
tree348acf3fce6ae375c347f5be08e40bd01306c64c
parent02e0d144e8564401fa5797978e91a2494d42ea79 (diff)
downloadscummvm-rg350-532c8c4230f6e9dcea58642094b893da0f0f75a5.tar.gz
scummvm-rg350-532c8c4230f6e9dcea58642094b893da0f0f75a5.tar.bz2
scummvm-rg350-532c8c4230f6e9dcea58642094b893da0f0f75a5.zip
Detach the player callback handler when the music is being unloaded. Fixes bug #1734416 - "AUDIO: ITE: Random crashes with the MIDI parser"
svn-id: r28696
-rw-r--r--sound/midiparser.cpp5
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;