diff options
-rw-r--r-- | engines/hugo/hugo.cpp | 2 | ||||
-rw-r--r-- | engines/hugo/object.cpp | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp index c3e4658e8b..a270ec773e 100644 --- a/engines/hugo/hugo.cpp +++ b/engines/hugo/hugo.cpp @@ -81,6 +81,7 @@ HugoEngine::HugoEngine(OSystem *syst, const HugoGameDescription *gd) : Engine(sy DebugMan.addDebugChannel(kDebugObject, "Object", "Object debug level"); _console = new HugoConsole(this); + _rnd = 0; } HugoEngine::~HugoEngine() { @@ -167,6 +168,7 @@ HugoEngine::~HugoEngine() { DebugMan.clearAllDebugChannels(); delete _console; + delete _rnd; } GameType HugoEngine::getGameType() const { 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; } /** |