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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Wed Oct 14 13:29:09 CEST 2009


Revision: 45070
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45070&view=rev
Author:   thebluegr
Date:     2009-10-14 11:29:09 +0000 (Wed, 14 Oct 2009)

Log Message:
-----------
Plugged loads of memory leaks in the new GUI

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

Modified: scummvm/trunk/engines/sci/gui/gui_animate.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_animate.cpp	2009-10-14 11:28:50 UTC (rev 45069)
+++ scummvm/trunk/engines/sci/gui/gui_animate.cpp	2009-10-14 11:29:09 UTC (rev 45070)
@@ -205,6 +205,8 @@
 		listEntry->signal = signal;
 
 		listIterator++;
+
+		delete view;
 	}
 }
 
@@ -466,6 +468,8 @@
 		}
 
 		listIterator++;
+
+		delete view;
 	}
 }
 
@@ -478,6 +482,8 @@
 	// Create rect according to coordinates and given cel
 	view->getCelRect(loopNo, celNo, leftPos, topPos, priority, &celRect);
 	_gfx->drawCel(view, loopNo, celNo, celRect, priority, 0);
+
+	delete view;
 }
 
 } // End of namespace Sci

Modified: scummvm/trunk/engines/sci/gui/gui_gfx.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-14 11:28:50 UTC (rev 45069)
+++ scummvm/trunk/engines/sci/gui/gui_gfx.cpp	2009-10-14 11:29:09 UTC (rev 45070)
@@ -671,8 +671,10 @@
 		rect.bottom = rect.top + view->getHeight(loopNo, celNo);
 		clipRect = rect;
 		clipRect.clip(_curPort->rect);
-		if (clipRect.isEmpty()) // nothing to draw
+		if (clipRect.isEmpty()) {	// nothing to draw
+			delete view;
 			return;
+		}
 
 		Common::Rect clipRectTranslated = clipRect;
 		OffsetRect(clipRectTranslated);
@@ -680,6 +682,8 @@
 		if (!_screen->_picNotValid)
 			BitsShow(rect);
 	}
+
+	delete view;
 }
 
 // This version of drawCel is not supposed to call BitsShow()!
@@ -689,13 +693,17 @@
 	if (view) {
 		clipRect = celRect;
 		clipRect.clip(_curPort->rect);
-		if (clipRect.isEmpty()) // nothing to draw
+		if (clipRect.isEmpty()) { // nothing to draw
+			delete view;
 			return;
+		}
 
 		Common::Rect clipRectTranslated = clipRect;
 		OffsetRect(clipRectTranslated);
 		view->draw(celRect, clipRect, clipRectTranslated, loopNo, celNo, priority, paletteNo);
 	}
+
+	delete view;
 }
 
 // This version of drawCel is not supposed to call BitsShow()!
@@ -1026,6 +1034,8 @@
 		PUT_SEL32V(objectReference, nsTop, celRect.top);
 		PUT_SEL32V(objectReference, nsBottom, celRect.bottom);
 	}
+
+	delete view;
 }
 
 } // End of namespace Sci


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