diff options
author | David Turner | 2011-01-25 08:24:57 +0000 |
---|---|---|
committer | David Turner | 2011-01-25 08:24:57 +0000 |
commit | b52859323c68fa87a167fed8af5c8f3f945e6cd8 (patch) | |
tree | da7256517a685fc555217ee8ab871a7fea3b446d /engines/lastexpress/game/sound.cpp | |
parent | 6400659ead45000485ddfbeb22ba9d48f1b7bde2 (diff) | |
download | scummvm-rg350-b52859323c68fa87a167fed8af5c8f3f945e6cd8.tar.gz scummvm-rg350-b52859323c68fa87a167fed8af5c8f3f945e6cd8.tar.bz2 scummvm-rg350-b52859323c68fa87a167fed8af5c8f3f945e6cd8.zip |
LASTEXPRESS: Fixed Memory Leak in Subtitles.
Also, fixed minor uninitialised read in animation event polling.
svn-id: r55524
Diffstat (limited to 'engines/lastexpress/game/sound.cpp')
-rw-r--r-- | engines/lastexpress/game/sound.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/lastexpress/game/sound.cpp b/engines/lastexpress/game/sound.cpp index 6392efe522..652703c285 100644 --- a/engines/lastexpress/game/sound.cpp +++ b/engines/lastexpress/game/sound.cpp @@ -119,9 +119,12 @@ SoundManager::SoundManager(LastExpressEngine *engine) : _engine(engine), _state( SoundManager::~SoundManager() { for (Common::List<SoundEntry *>::iterator i = _cache.begin(); i != _cache.end(); ++i) SAFE_DELETE(*i); - _cache.clear(); + for (Common::List<SubtitleEntry *>::iterator i = _subtitles.begin(); i != _subtitles.end(); ++i) + SAFE_DELETE(*i); + _subtitles.clear(); + _currentSubtitle = NULL; // Zero passed pointers |