aboutsummaryrefslogtreecommitdiff
path: root/simon/sound.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'simon/sound.cpp')
-rw-r--r--simon/sound.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/simon/sound.cpp b/simon/sound.cpp
index df27b1d0b0..9b24987356 100644
--- a/simon/sound.cpp
+++ b/simon/sound.cpp
@@ -138,12 +138,14 @@ void SimonSound::readSfxFile(const char *filename, const char *gameDataPath) {
}
}
+ delete _effects;
_effects = new WavSound(_mixer, file);
}
void SimonSound::loadSfxTable(File *gameFile, uint32 base) {
stopAll();
+ delete _effects;
if (_game & GF_WIN)
_effects = new WavSound(_mixer, gameFile, base);
else
@@ -159,6 +161,7 @@ void SimonSound::playVoice(uint sound) {
if (file->isOpen() == false) {
warning("Can't open voice file %s", filename);
} else {
+ delete _voice;
_voice = new WavSound(_mixer, file, _offsets);
}
}
@@ -265,6 +268,11 @@ SimonSound::Sound::Sound(SoundMixer *mixer, File *file, uint32 *offsets) {
_offsets = offsets;
}
+SimonSound::Sound::~Sound() { delete _file; }
+SimonSound::WavSound::~WavSound() { delete _file; }
+SimonSound::VocSound::~VocSound() { delete _file; }
+SimonSound::MP3Sound::~MP3Sound() { delete _file; }
+
#if !defined(__GNUC__)
#pragma START_PACK_STRUCTS
#endif