diff options
author | Andrew Kurushin | 2006-03-02 18:25:56 +0000 |
---|---|---|
committer | Andrew Kurushin | 2006-03-02 18:25:56 +0000 |
commit | 55898dfe61b6480a615803f3d432d105af874bfc (patch) | |
tree | bd628b6312938e49fac7bd3fec3e8902e5aa2c0d /engines/saga/music.cpp | |
parent | 491cbcec5b88e7cb9fb9da901ee64a7b3cec73fd (diff) | |
download | scummvm-rg350-55898dfe61b6480a615803f3d432d105af874bfc.tar.gz scummvm-rg350-55898dfe61b6480a615803f3d432d105af874bfc.tar.bz2 scummvm-rg350-55898dfe61b6480a615803f3d432d105af874bfc.zip |
apply CYX mem-leak fix patch
svn-id: r21013
Diffstat (limited to 'engines/saga/music.cpp')
-rw-r--r-- | engines/saga/music.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp index e352818ee6..921c1a9f1a 100644 --- a/engines/saga/music.cpp +++ b/engines/saga/music.cpp @@ -305,6 +305,8 @@ Music::Music(SagaEngine *vm, Audio::Mixer *mixer, MidiDriver *driver, int enable _songTable = 0; _track = NULL; + + _midiMusicData = NULL; } Music::~Music() { @@ -316,6 +318,7 @@ Music::~Music() { delete smfParser; free(_songTable); + free(_midiMusicData); } void Music::musicVolumeGaugeCallback(void *refCon) { @@ -432,7 +435,6 @@ void Music::play(uint32 resourceId, MusicFlags flags) { flags = MUSIC_NORMAL; } - // FIXME: Is resource_data ever freed? // Load MIDI/XMI resource data if (_vm->getGameType() == GType_ITE) { @@ -506,6 +508,8 @@ void Music::play(uint32 resourceId, MusicFlags flags) { _player->setLoop(false); _player->playMusic(); + free(_midiMusicData); + _midiMusicData = resourceData; } void Music::pause(void) { |