aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2014-08-27 22:34:50 -0400
committerPaul Gilbert2014-08-27 22:34:50 -0400
commit3bbec487a53243464030fe1946f833971d6e14c0 (patch)
tree784075ca6cb7a2ab0a42d806419ed74a35fdee1b
parent35923890ccb26d958d33c6c472a1b16659718392 (diff)
downloadscummvm-rg350-3bbec487a53243464030fe1946f833971d6e14c0.tar.gz
scummvm-rg350-3bbec487a53243464030fe1946f833971d6e14c0.tar.bz2
scummvm-rg350-3bbec487a53243464030fe1946f833971d6e14c0.zip
ACCESS: Fixes for memory leaks
-rw-r--r--engines/access/files.cpp2
-rw-r--r--engines/access/files.h2
-rw-r--r--engines/access/room.cpp1
3 files changed, 4 insertions, 1 deletions
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;