[Scummvm-cvs-logs] CVS: scummvm/sword1 screen.cpp,1.37,1.37.2.1

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Sun Feb 22 08:15:02 CET 2004


Update of /cvsroot/scummvm/scummvm/sword1
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24356

Modified Files:
      Tag: branch-0-6-0
	screen.cpp 
Log Message:
Free _screenBuf and _screenGrid before allocating new ones.


Index: screen.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/screen.cpp,v
retrieving revision 1.37
retrieving revision 1.37.2.1
diff -u -d -r1.37 -r1.37.2.1
--- screen.cpp	18 Jan 2004 05:52:04 -0000	1.37
+++ screen.cpp	22 Feb 2004 16:01:51 -0000	1.37.2.1
@@ -265,6 +265,10 @@
 		Logic::_scriptVars[SCROLL_OFFSET_X] = 0;
 		Logic::_scriptVars[SCROLL_OFFSET_Y] = 0;
 	}
+	if (_screenBuf)
+		free(_screenBuf);
+	if (_screenGrid)
+		free(_screenGrid);
 	_screenBuf = (uint8*)malloc(_scrnSizeX * _scrnSizeY);
 	_screenGrid = (uint8*)malloc(_gridSizeX * _gridSizeY);
 	memset(_screenGrid, 0, _gridSizeX * _gridSizeY);





More information about the Scummvm-git-logs mailing list