diff options
author | Oliver Kiehl | 2002-11-09 22:16:07 +0000 |
---|---|---|
committer | Oliver Kiehl | 2002-11-09 22:16:07 +0000 |
commit | 9659006f848aae109e067b5da0222c105b9d229c (patch) | |
tree | a9b61b075896d511d34b911715ada03c17e924b4 | |
parent | 782a310a2e83e8e30e3b2013db3ace564448644d (diff) | |
download | scummvm-rg350-9659006f848aae109e067b5da0222c105b9d229c.tar.gz scummvm-rg350-9659006f848aae109e067b5da0222c105b9d229c.tar.bz2 scummvm-rg350-9659006f848aae109e067b5da0222c105b9d229c.zip |
fixed some memory leaks
svn-id: r5477
-rw-r--r-- | simon/simon.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/simon/simon.cpp b/simon/simon.cpp index 14e2f3251f..21d9983c31 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -3280,6 +3280,9 @@ void SimonState::readSfxFile(const char *filename) if (_game == GAME_SIMON1WIN) { /* simon 1 win */ uint32 size; + if (_effects_offsets) + free(_effects_offsets); + if (_effects_file->isOpen() == true) _effects_file->close(); @@ -4871,7 +4874,8 @@ void SimonState::playVoc(File *sound_file, uint32 *offsets, uint sound, PlayingS byte *buffer = (byte *)malloc(size); sound_file->read(buffer, size); - _mixer->playRaw(sound_handle, buffer, size, samples_per_sec, SoundMixer::FLAG_UNSIGNED); + _mixer->playRaw(sound_handle, buffer, size, samples_per_sec, + SoundMixer::FLAG_UNSIGNED|SoundMixer::FLAG_AUTOFREE); } void SimonState::playWav(File *sound_file, uint32 *offsets, uint sound, PlayingSoundHandle *sound_handle) @@ -4904,7 +4908,7 @@ void SimonState::playWav(File *sound_file, uint32 *offsets, uint sound, PlayingS sound_file->read(buffer, data[1]); _mixer->playRaw(sound_handle, buffer, data[1], READ_LE_UINT32(&wave_hdr.samples_per_sec), - SoundMixer::FLAG_UNSIGNED); + SoundMixer::FLAG_UNSIGNED|SoundMixer::FLAG_AUTOFREE); } void SimonState::playVoice(uint voice) |