From 3bbec487a53243464030fe1946f833971d6e14c0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 27 Aug 2014 22:34:50 -0400 Subject: ACCESS: Fixes for memory leaks --- engines/access/files.cpp | 2 ++ engines/access/files.h | 2 +- engines/access/room.cpp | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'engines/access') diff --git a/engines/access/files.cpp b/engines/access/files.cpp index 78cb3eff51..233d040745 100644 --- a/engines/access/files.cpp +++ b/engines/access/files.cpp @@ -51,9 +51,11 @@ CellIdent::CellIdent(int cell, int fileNum, int subfile) { Resource::Resource() { _stream = nullptr; _size = 0; + _data = nullptr; } Resource::~Resource() { + delete _data; delete _stream; } diff --git a/engines/access/files.h b/engines/access/files.h index 457cb81f86..0a934de8aa 100644 --- a/engines/access/files.h +++ b/engines/access/files.h @@ -101,7 +101,7 @@ public: /** * Check the existence of a given file */ - bool FileManager::existFile(const Common::String &filename); + bool existFile(const Common::String &filename); /** * Load a given subfile from a container file diff --git a/engines/access/room.cpp b/engines/access/room.cpp index 0de6497422..a33bc76e66 100644 --- a/engines/access/room.cpp +++ b/engines/access/room.cpp @@ -207,6 +207,7 @@ void Room::loadRoomData(const byte *roomData) { if (roomInfo._animFile._fileNum != -1) { Resource *anim = _vm->_files->loadFile(roomInfo._animFile); _vm->_animation->loadAnimations(anim); + delete anim; } _vm->_scale = _vm->_scaleI = roomInfo._scaleI; -- cgit v1.2.3