aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2010-11-14 00:35:13 +0000
committerPaul Gilbert2010-11-14 00:35:13 +0000
commitdb24b2a01415627ac540bf96e54902de2956b12b (patch)
treea6204ae9f3b86f693d50ab713df10c598b26a708
parent4e357549d57c1d820e320461450d52e36d10f477 (diff)
downloadscummvm-rg350-db24b2a01415627ac540bf96e54902de2956b12b.tar.gz
scummvm-rg350-db24b2a01415627ac540bf96e54902de2956b12b.tar.bz2
scummvm-rg350-db24b2a01415627ac540bf96e54902de2956b12b.zip
LURE: Fix for Valgrind identified memory leaks
svn-id: r54236
-rw-r--r--engines/lure/menu.cpp2
-rw-r--r--engines/lure/res_struct.h4
2 files changed, 6 insertions, 0 deletions
diff --git a/engines/lure/menu.cpp b/engines/lure/menu.cpp
index 58364d4cb1..76b1d78823 100644
--- a/engines/lure/menu.cpp
+++ b/engines/lure/menu.cpp
@@ -629,6 +629,8 @@ uint16 PopupMenu::Show(int numEntries, const char *actions[]) {
}
bail_out:
+ delete s;
+
#ifndef LURE_CLICKABLE_MENUS
mouse.setPosition(oldX, oldY);
mouse.cursorOn();
diff --git a/engines/lure/res_struct.h b/engines/lure/res_struct.h
index 9b2a4c79f8..e4b8c02f6a 100644
--- a/engines/lure/res_struct.h
+++ b/engines/lure/res_struct.h
@@ -445,6 +445,10 @@ public:
void setRoomNumber(uint16 roomNum) { _roomNumber = roomNum; }
void setSupportData(CharacterScheduleEntry *newRec) {
assert((newRec == NULL) || (newRec->parent() != NULL));
+ if (_dynamicSupportData) {
+ delete _supportData;
+ _dynamicSupportData = false;
+ }
_supportData = newRec;
}
void setSupportData(uint16 entryId);