aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/fullpipe/motion.cpp13
-rw-r--r--engines/fullpipe/motion.h1
2 files changed, 13 insertions, 1 deletions
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index 5e399a2fe9..30f71aa0b3 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -196,6 +196,10 @@ MctlLadder::MctlLadder() {
_ladder_field_24 = 0;
}
+MctlLadder::~MctlLadder() {
+ freeItems();
+}
+
int MctlLadder::collisionDetection(StaticANIObject *man) {
warning("STUB: MctlLaddercollisionDetection()");
@@ -270,7 +274,14 @@ bool MctlLadder::initMovement(StaticANIObject *ani, MctlLadderMovement *movement
}
void MctlLadder::freeItems() {
- warning("STUB: MctlLadder::freeItems()");
+ _mgm.clear();
+
+ for (Common::List<MctlLadderMovement *>::iterator it = _movements.begin(); it != _movements.end(); ++it) {
+ delete (*it)->movVars;
+ delete [] (*it)->staticIds;
+ }
+
+ _movements.clear();
}
MessageQueue *MctlLadder::method34(StaticANIObject *subj, int xpos, int ypos, int fuzzyMatch, int staticsId) {
diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h
index 92240506b4..5988b71d15 100644
--- a/engines/fullpipe/motion.h
+++ b/engines/fullpipe/motion.h
@@ -191,6 +191,7 @@ public:
public:
MctlLadder();
+ virtual ~MctlLadder();
int collisionDetection(StaticANIObject *man);
virtual void addObject(StaticANIObject *obj);