aboutsummaryrefslogtreecommitdiff
path: root/engines/hugo/object.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/hugo/object.cpp')
-rw-r--r--engines/hugo/object.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/engines/hugo/object.cpp b/engines/hugo/object.cpp
index 15f5e4fe06..b8e1b34de5 100644
--- a/engines/hugo/object.cpp
+++ b/engines/hugo/object.cpp
@@ -343,7 +343,12 @@ bool ObjectHandler::findObjectSpace(object_t *obj, int16 *destx, int16 *desty) {
* Free ObjectArr (before exiting)
*/
void ObjectHandler::freeObjectArr() {
+ for(int16 i = 0; i < _objCount; i++) {
+ free(_objects[i].stateDataIndex);
+ _objects[i].stateDataIndex = 0;
+ }
free(_objects);
+ _objects = 0;
}
/**