[Scummvm-devel] SF.net SVN: scummvm: [28696] scummvm/trunk/sound/midiparser.cpp
Gregory Montoir
cyx at users.sourceforge.net
Wed Aug 22 22:35:14 CEST 2007
thebluegr at users.sourceforge.net wrote:
> Revision: 28696
> http://scummvm.svn.sourceforge.net/scummvm/?rev=28696&view=rev
> Author: thebluegr
> Date: 2007-08-22 05:20:21 -0700 (Wed, 22 Aug 2007)
>
> Log Message:
> -----------
> Detach the player callback handler when the music is being unloaded. Fixes bug #1734416 - "AUDIO: ITE: Random crashes with the MIDI parser"
>
> Modified Paths:
> --------------
> scummvm/trunk/sound/midiparser.cpp
>
> Modified: scummvm/trunk/sound/midiparser.cpp
> ===================================================================
> --- scummvm/trunk/sound/midiparser.cpp 2007-08-22 11:28:11 UTC (rev 28695)
> +++ scummvm/trunk/sound/midiparser.cpp 2007-08-22 12:20:21 UTC (rev 28696)
> @@ -407,6 +407,11 @@
> }
>
> 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;
I could be wrong but... what does this change really fix something ?
Looking at saga/music.h, MusicPlayer::setTimerCallback is implemented
as a no-op function (like most Midi/MusicPlayer classes used in the
engines code).
More information about the Scummvm-devel
mailing list