diff options
-rw-r--r-- | engines/sherlock/music.cpp | 5 | ||||
-rw-r--r-- | engines/sherlock/music.h | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/engines/sherlock/music.cpp b/engines/sherlock/music.cpp index 7ab5cd4b4f..8b8f359de3 100644 --- a/engines/sherlock/music.cpp +++ b/engines/sherlock/music.cpp @@ -225,6 +225,7 @@ Music::Music(SherlockEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer) { _musicOn = false; _midiOption = false; _musicVolume = 0; + _midiMusicData = nullptr; if (IS_3DO) { // 3DO - uses digital samples for music @@ -470,8 +471,8 @@ bool Music::playMusic(const Common::String &name) { } } + _midiMusicData = midiMusicData; _midiParser->loadMusic(midiMusicData, midiMusicDataSize); - } else { // 3DO: sample based Audio::AudioStream *musicStream; @@ -517,6 +518,8 @@ void Music::freeSong() { _midiParser->unloadMusic(); } + delete[] _midiMusicData; + _midiMusicData = nullptr; _musicPlaying = false; } diff --git a/engines/sherlock/music.h b/engines/sherlock/music.h index 72a5f48833..186e2aa2dc 100644 --- a/engines/sherlock/music.h +++ b/engines/sherlock/music.h @@ -68,6 +68,7 @@ private: MidiDriver *_midiDriver; Audio::SoundHandle _digitalMusicHandle; MusicType _musicType; + byte *_midiMusicData; /** * Play the specified music resource |