diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/sound/qmixer.cpp | 9 | ||||
-rw-r--r-- | engines/titanic/sound/qmixer.h | 3 |
2 files changed, 11 insertions, 1 deletions
diff --git a/engines/titanic/sound/qmixer.cpp b/engines/titanic/sound/qmixer.cpp index a3c06da2f8..a1091a9763 100644 --- a/engines/titanic/sound/qmixer.cpp +++ b/engines/titanic/sound/qmixer.cpp @@ -29,6 +29,10 @@ namespace Titanic { QMixer::QMixer(Audio::Mixer *mixer) : _mixer(mixer) { } +QMixer::~QMixer() { + _channels.clear(); +} + bool QMixer::qsWaveMixInitEx(const QMIXCONFIG &config) { assert(_channels.empty()); assert(config.iChannels > 0 && config.iChannels < 256); @@ -237,6 +241,11 @@ void QMixer::qsWaveMixPump() { /*------------------------------------------------------------------------*/ +QMixer::ChannelEntry::~ChannelEntry() { + for (Common::List<SoundEntry>::iterator i = _sounds.begin(); i != _sounds.end(); ++i) + delete (*i)._waveFile; +} + byte QMixer::ChannelEntry::getRawVolume() const { // Emperically decided adjustment divisor for distances const double ADJUSTMENT_FACTOR = 5.0; diff --git a/engines/titanic/sound/qmixer.h b/engines/titanic/sound/qmixer.h index 17ca441e83..c6d7fcd520 100644 --- a/engines/titanic/sound/qmixer.h +++ b/engines/titanic/sound/qmixer.h @@ -204,6 +204,7 @@ class QMixer { ChannelEntry() : _volume(0), _panRate(0), _volumeChangeStart(0), _volumeChangeEnd(0), _volumeStart(0), _volumeEnd(0), _distance(0.0), _resetDistance(true) {} + ~ChannelEntry(); /** * Calculates the raw volume level to pass to ScummVM playStream, taking @@ -217,7 +218,7 @@ protected: Audio::Mixer *_mixer; public: QMixer(Audio::Mixer *mixer); - virtual ~QMixer() {} + virtual ~QMixer(); /** * Initializes the mixer |