aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorJohannes Schickel2010-01-12 20:08:17 +0000
committerJohannes Schickel2010-01-12 20:08:17 +0000
commit36444740b3e02318c8334475cdf5d5967c733719 (patch)
tree4cb57104c589b10129e5a67520c2efac8c0ea64f /engines/sci
parent7ed214697701e021827cc1450fda880483873021 (diff)
downloadscummvm-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.cpp3
-rw-r--r--engines/sci/sound/soundcmd.h3
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