[Scummvm-cvs-logs] SF.net SVN: scummvm:[55524] scummvm/trunk/engines/lastexpress

tdhs at users.sourceforge.net tdhs at users.sourceforge.net
Tue Jan 25 09:24:57 CET 2011


Revision: 55524
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55524&view=rev
Author:   tdhs
Date:     2011-01-25 08:24:57 +0000 (Tue, 25 Jan 2011)

Log Message:
-----------
LASTEXPRESS: Fixed Memory Leak in Subtitles.

Also, fixed minor uninitialised read in animation event polling.

Modified Paths:
--------------
    scummvm/trunk/engines/lastexpress/data/animation.cpp
    scummvm/trunk/engines/lastexpress/game/sound.cpp

Modified: scummvm/trunk/engines/lastexpress/data/animation.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/data/animation.cpp	2011-01-25 04:25:06 UTC (rev 55523)
+++ scummvm/trunk/engines/lastexpress/data/animation.cpp	2011-01-25 08:24:57 UTC (rev 55524)
@@ -286,7 +286,7 @@
 		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

Modified: scummvm/trunk/engines/lastexpress/game/sound.cpp
===================================================================
--- scummvm/trunk/engines/lastexpress/game/sound.cpp	2011-01-25 04:25:06 UTC (rev 55523)
+++ scummvm/trunk/engines/lastexpress/game/sound.cpp	2011-01-25 08:24:57 UTC (rev 55524)
@@ -119,9 +119,12 @@
 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


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list