[Scummvm-cvs-logs] CVS: scummvm/sword2 maketext.h,1.13,1.14

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Tue Aug 24 22:58:01 CEST 2004


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

Modified Files:
	maketext.h 
Log Message:
Added a destructor to the FontRenderer class to free any remaining text
sprites on exit. As far as I can tell, the only case when this makes any
difference is when there is text on screen when you quit ScummVM, so it's
not really a memory leak, but Valgrind will report it as one.


Index: maketext.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/maketext.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- maketext.h	23 Apr 2004 07:01:38 -0000	1.13
+++ maketext.h	25 Aug 2004 05:57:17 -0000	1.14
@@ -99,6 +99,11 @@
 			_blocList[i].text_mem = NULL;
 	}
 
+	~FontRenderer() {
+		for (int i = 0; i < MAX_text_blocs; i++)
+			free(_blocList[i].text_mem);
+	}
+
 	byte *makeTextSprite(byte *sentence, uint16 maxWidth, uint8 pen, uint32 fontRes, uint8 border = BORDER_PEN);
 
 	void killTextBloc(uint32 bloc_number);





More information about the Scummvm-git-logs mailing list