[Scummvm-cvs-logs] scummvm master -> bcb9179a8b4128469700af62463674febf2785c6

digitall digitall at scummvm.org
Thu Mar 24 22:01:45 CET 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
bcb9179a8b SCI: Close Memory Leak from kAnimate Calls.


Commit: bcb9179a8b4128469700af62463674febf2785c6
    https://github.com/scummvm/scummvm/commit/bcb9179a8b4128469700af62463674febf2785c6
Author: D G Turner (digitall at scummvm.org)
Date: 2011-03-24T13:59:20-07:00

Commit Message:
SCI: Close Memory Leak from kAnimate Calls.

This was due to a missing destructor in the HunkTable.
Thanks to wjp for this patch.

Changed paths:
    engines/sci/engine/segment.h



diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h
index ffde01f..947953e 100644
--- a/engines/sci/engine/segment.h
+++ b/engines/sci/engine/segment.h
@@ -318,6 +318,12 @@ struct ListTable : public SegmentObjTable<List> {
 /* HunkTable */
 struct HunkTable : public SegmentObjTable<Hunk> {
 	HunkTable() : SegmentObjTable<Hunk>(SEG_TYPE_HUNK) {}
+	virtual ~HunkTable() {
+		for (uint i = 0; i < _table.size(); i++) {
+			if (isValidEntry(i))
+				freeEntryContents(i);
+		}
+	}
 
 	void freeEntryContents(int idx) {
 		free(_table[idx].mem);






More information about the Scummvm-git-logs mailing list