diff options
author | Johannes Schickel | 2010-01-12 20:08:17 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-01-12 20:08:17 +0000 |
commit | 36444740b3e02318c8334475cdf5d5967c733719 (patch) | |
tree | 4cb57104c589b10129e5a67520c2efac8c0ea64f /engines/sci | |
parent | 7ed214697701e021827cc1450fda880483873021 (diff) | |
download | scummvm-rg350-36444740b3e02318c8334475cdf5d5967c733719.tar.gz scummvm-rg350-36444740b3e02318c8334475cdf5d5967c733719.tar.bz2 scummvm-rg350-36444740b3e02318c8334475cdf5d5967c733719.zip |
Fix some memory leaks caused by never deleting the objects inside SoundCommandParser::_soundCommands.
svn-id: r47274
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/sound/soundcmd.cpp | 3 | ||||
-rw-r--r-- | engines/sci/sound/soundcmd.h | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp index a28b330552..51c0006747 100644 --- a/engines/sci/sound/soundcmd.cpp +++ b/engines/sci/sound/soundcmd.cpp @@ -206,6 +206,9 @@ SoundCommandParser::SoundCommandParser(ResourceManager *resMan, SegManager *segM } SoundCommandParser::~SoundCommandParser() { + for (SoundCommandContainer::iterator i = _soundCommands.begin(); i != _soundCommands.end(); ++i) + delete *i; + delete _music; } diff --git a/engines/sci/sound/soundcmd.h b/engines/sci/sound/soundcmd.h index 94e0698523..7c1995e8d4 100644 --- a/engines/sci/sound/soundcmd.h +++ b/engines/sci/sound/soundcmd.h @@ -77,7 +77,8 @@ public: #endif private: - Common::Array<MusicEntryCommand*> _soundCommands; + typedef Common::Array<MusicEntryCommand *> SoundCommandContainer; + SoundCommandContainer _soundCommands; ResourceManager *_resMan; SegManager *_segMan; #ifdef USE_OLD_MUSIC_FUNCTIONS |