diff options
Diffstat (limited to 'simon/sound.cpp')
-rw-r--r-- | simon/sound.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/simon/sound.cpp b/simon/sound.cpp index d38cd3903f..d04a919dc4 100644 --- a/simon/sound.cpp +++ b/simon/sound.cpp @@ -31,7 +31,7 @@ protected: public: BaseSound(SoundMixer *mixer, File *file, uint32 base = 0); BaseSound(SoundMixer *mixer, File *file, uint32 *offsets); - virtual ~BaseSound() { delete _file; } + virtual ~BaseSound(); virtual int playSound(uint sound, PlayingSoundHandle *handle, byte flags = 0) = 0; }; @@ -91,6 +91,11 @@ BaseSound::BaseSound(SoundMixer *mixer, File *file, uint32 *offsets) { _offsets = offsets; } +BaseSound::~BaseSound() { + free(_offsets); + delete _file; +} + #if !defined(__GNUC__) #pragma START_PACK_STRUCTS #endif @@ -322,6 +327,14 @@ SimonSound::SimonSound(const byte game, const GameSpecificSettings *gss, const c } } +SimonSound::~SimonSound() { + delete _voice; + delete _effects; + + free(_filenums); + free(_offsets); +} + void SimonSound::readSfxFile(const char *filename, const char *gameDataPath) { stopAll(); |