diff options
author | Matthew Hoops | 2010-07-09 16:53:50 +0000 |
---|---|---|
committer | Matthew Hoops | 2010-07-09 16:53:50 +0000 |
commit | 0e4bf4aff70846b77bac2f39d0f031cede6afa05 (patch) | |
tree | bca0536b73412d931eaf8c19c2ee62b21ce03e28 /engines/mohawk | |
parent | 541daf918aa9734692b7a58ec80ba03a975bd8fb (diff) | |
download | scummvm-rg350-0e4bf4aff70846b77bac2f39d0f031cede6afa05.tar.gz scummvm-rg350-0e4bf4aff70846b77bac2f39d0f031cede6afa05.tar.bz2 scummvm-rg350-0e4bf4aff70846b77bac2f39d0f031cede6afa05.zip |
Fix some other valgrind warnings.
svn-id: r50762
Diffstat (limited to 'engines/mohawk')
-rw-r--r-- | engines/mohawk/sound.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp index 5e1ea8cdb2..091bd68021 100644 --- a/engines/mohawk/sound.cpp +++ b/engines/mohawk/sound.cpp @@ -233,6 +233,10 @@ void Sound::playSLST(uint16 index, uint16 card) { if (slstRecord.index == index) { playSLST(slstRecord); + delete[] slstRecord.sound_ids; + delete[] slstRecord.volumes; + delete[] slstRecord.balances; + delete[] slstRecord.u2; delete slstStream; return; } @@ -244,6 +248,7 @@ void Sound::playSLST(uint16 index, uint16 card) { } delete slstStream; + // No matching records, assume we need to stop all SLST's stopAllSLST(); } @@ -277,8 +282,11 @@ void Sound::playSLST(SLSTRecord slstRecord) { } void Sound::stopAllSLST() { - for (uint16 i = 0; i < _currentSLSTSounds.size(); i++) + for (uint16 i = 0; i < _currentSLSTSounds.size(); i++) { _vm->_mixer->stopHandle(*_currentSLSTSounds[i].handle); + delete _currentSLSTSounds[i].handle; + } + _currentSLSTSounds.clear(); } @@ -314,6 +322,7 @@ void Sound::playSLSTSound(uint16 id, bool fade, bool loop, uint16 volume, int16 void Sound::stopSLSTSound(uint16 index, bool fade) { // TODO: Fade out, mixer needs to be extended to get volume on a handle _vm->_mixer->stopHandle(*_currentSLSTSounds[index].handle); + delete _currentSLSTSounds[index].handle; _currentSLSTSounds.remove_at(index); } |