[Scummvm-git-logs] scummvm master -> 947894ce1f71c12cc904b1c2fd82aa827df8574f
dreammaster
dreammaster at scummvm.org
Sun Sep 24 16:50:19 CEST 2017
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
947894ce1f TITANIC: Free any active wave files on exit
Commit: 947894ce1f71c12cc904b1c2fd82aa827df8574f
https://github.com/scummvm/scummvm/commit/947894ce1f71c12cc904b1c2fd82aa827df8574f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-09-24T10:48:04-04:00
Commit Message:
TITANIC: Free any active wave files on exit
Changed paths:
engines/titanic/sound/qmixer.cpp
engines/titanic/sound/qmixer.h
diff --git a/engines/titanic/sound/qmixer.cpp b/engines/titanic/sound/qmixer.cpp
index a3c06da..a1091a9 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 17ca441..c6d7fcd 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
More information about the Scummvm-git-logs
mailing list