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 | |
| 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')
| -rw-r--r-- | engines/lastexpress/data/animation.cpp | 2 | ||||
| -rw-r--r-- | engines/lastexpress/game/sound.cpp | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/engines/lastexpress/data/animation.cpp b/engines/lastexpress/data/animation.cpp index d105a34f8c..7288889f09 100644 --- a/engines/lastexpress/data/animation.cpp +++ b/engines/lastexpress/data/animation.cpp @@ -286,7 +286,7 @@ void Animation::play() { g_engine->_system->delayMillis(20); // Handle right-click to interrupt animations - Common::Event ev; + Common::Event ev = Common::Event(); while (g_engine->getEventManager()->pollEvent(ev)) { if (ev.type == Common::EVENT_RBUTTONUP) { // Stop audio 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 |
