diff options
author | Robert Göffringmann | 2004-11-09 04:06:10 +0000 |
---|---|---|
committer | Robert Göffringmann | 2004-11-09 04:06:10 +0000 |
commit | 021f2cbccedfd2ed197bb4c54c3d5cf1fc3ca89f (patch) | |
tree | 44168e257d52b634893f7d01e3ed717fb0326bef /sword1/sound.cpp | |
parent | daee2edcfea567456bc94534e1cadcd988b6ad69 (diff) | |
download | scummvm-rg350-021f2cbccedfd2ed197bb4c54c3d5cf1fc3ca89f.tar.gz scummvm-rg350-021f2cbccedfd2ed197bb4c54c3d5cf1fc3ca89f.tar.bz2 scummvm-rg350-021f2cbccedfd2ed197bb4c54c3d5cf1fc3ca89f.zip |
free memory on quit.
Still leaks some, though
svn-id: r15735
Diffstat (limited to 'sword1/sound.cpp')
-rw-r--r-- | sword1/sound.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sword1/sound.cpp b/sword1/sound.cpp index f33f1cf36c..550d8dd54b 100644 --- a/sword1/sound.cpp +++ b/sword1/sound.cpp @@ -41,6 +41,16 @@ Sound::Sound(const char *searchPath, SoundMixer *mixer, ResMan *pResMan) { _speechVolL = _speechVolR = _sfxVolL = _sfxVolR = 192; } +Sound::~Sound(void) { + // clean up fx queue + _mixer->stopAll(); + for (uint8 cnt = 0; cnt < _endOfQueue; cnt++) + if (_fxQueue[cnt].delay == 0) + _resMan->resClose(_fxList[_fxQueue[cnt].id].sampleId); + _endOfQueue = 0; + closeCowSystem(); +} + int Sound::addToQueue(int32 fxNo) { bool alreadyInQueue = false; for (uint8 cnt = 0; (cnt < _endOfQueue) && (!alreadyInQueue); cnt++) |