[Scummvm-cvs-logs] CVS: scummvm/sword2 logic.h,1.26,1.27 resman.cpp,1.82,1.83

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Tue Jan 6 23:43:01 CET 2004


Update of /cvsroot/scummvm/scummvm/sword2
In directory sc8-pr-cvs1:/tmp/cvs-serv19039

Modified Files:
	logic.h resman.cpp 
Log Message:
Valgrind fixes. Mostly about memory not being freed when the engine is
deleted.


Index: logic.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/logic.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- logic.h	6 Jan 2004 13:44:17 -0000	1.26
+++ logic.h	7 Jan 2004 07:42:00 -0000	1.27
@@ -164,16 +164,20 @@
 	Logic(Sword2Engine *vm) :
 		  _vm(vm), _globals(NULL), _kills(0), _debugFlag(false),
 		  _smackerLeadOut(0), _sequenceTextLines(0), _speechTime(0),
-		  _animId(0), _leftClickDelay(0), _rightClickDelay(0),
-		  _defaultResponseId(0), _totalStartups(0),
-		  _totalScreenManagers(0), _officialTextNumber(0),
-		  _speechScriptWaiting(0), _speechTextBlocNo(0),
-		  _choosing(false), _unpauseZone(0) {
+		  _animId(0), _speechAnimType(0), _leftClickDelay(0),
+		  _rightClickDelay(0), _defaultResponseId(0),
+		  _totalStartups(0), _totalScreenManagers(0),
+		  _officialTextNumber(0), _speechScriptWaiting(0),
+		  _speechTextBlocNo(0), _choosing(false), _unpauseZone(0) {
 		memset(_subjectList, 0, sizeof(_subjectList));
 		memset(_eventList, 0, sizeof(_eventList));
 		memset(_syncList, 0, sizeof(_syncList));
 		_router = new Router(_vm);
 		initStartMenu();
+	}
+
+	~Logic() {
+		delete _router;
 	}
 
 	// "TEXT" - current official text line number - will match the wav

Index: resman.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/resman.cpp,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- resman.cpp	6 Jan 2004 13:44:17 -0000	1.82
+++ resman.cpp	7 Jan 2004 07:42:00 -0000	1.83
@@ -73,6 +73,7 @@
 	uint32 j = 0;
 
 	_totalClusters = 0;
+	_resConvTable = NULL;
 
 	if (!file.open("resource.inf")) {
 		error("init cannot *OPEN* resource.inf");
@@ -192,6 +193,7 @@
 	free(_resList);
 	free(_age);
 	free(_count);
+	free(_resConvTable);
 }
 
 // Quick macro to make swapping in-place easier to write





More information about the Scummvm-git-logs mailing list