SCI: Close Memory Leak from kAnimate Calls.

This was due to a missing destructor in the HunkTable.
Thanks to wjp for this patch.
This commit is contained in:
D G Turner 2011-03-24 20:59:20 +00:00
parent e6080087c8
commit bcb9179a8b

View File

@ -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);