[Scummvm-cvs-logs] SF.net SVN: scummvm:[46938] scummvm/trunk/engines/sci/gui/gui_gfx.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sun Jan 3 19:37:13 CET 2010


Revision: 46938
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46938&view=rev
Author:   thebluegr
Date:     2010-01-03 18:37:13 +0000 (Sun, 03 Jan 2010)

Log Message:
-----------
Fixed memory leak (as reported by eriktorbjorn)

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gui/gui_gfx.cpp

Modified: scummvm/trunk/engines/sci/gui/gui_gfx.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2010-01-03 18:06:48 UTC (rev 46937)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2010-01-03 18:37:13 UTC (rev 46938)
@@ -318,14 +318,14 @@
 }
 
 void SciGuiGfx::drawPicture(GuiResourceId pictureId, int16 animationNr, bool mirroredFlag, bool addToFlag, GuiResourceId paletteId) {
-	SciGuiPicture *picture;
+	SciGuiPicture *picture = new SciGuiPicture(_resMan, this, _screen, _palette, pictureId);
 
-	picture = new SciGuiPicture(_resMan, this, _screen, _palette, pictureId);
 	// do we add to a picture? if not -> clear screen with white
-	if (!addToFlag) {
+	if (!addToFlag)
 		ClearScreen(_screen->_colorWhite);
-	}
+
 	picture->draw(animationNr, mirroredFlag, addToFlag, paletteId);
+	delete picture;
 }
 
 // This one is the only one that updates screen!


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