diff options
author | Nipun Garg | 2019-07-17 23:34:08 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:22 +0200 |
commit | d706fbf22e7399944c480339ec3a023d47dffb1a (patch) | |
tree | ebdf8a85e625beb5418f20e12cb070ae4213d20a | |
parent | ff2c6fe30a7aba9021f10abb64483a0c1857c077 (diff) | |
download | scummvm-rg350-d706fbf22e7399944c480339ec3a023d47dffb1a.tar.gz scummvm-rg350-d706fbf22e7399944c480339ec3a023d47dffb1a.tar.bz2 scummvm-rg350-d706fbf22e7399944c480339ec3a023d47dffb1a.zip |
HDB: Fix memory leaks
-rw-r--r-- | engines/hdb/file-manager.cpp | 4 | ||||
-rw-r--r-- | engines/hdb/file-manager.h | 1 | ||||
-rw-r--r-- | engines/hdb/gfx.cpp | 2 | ||||
-rw-r--r-- | engines/hdb/map.cpp | 3 |
4 files changed, 10 insertions, 0 deletions
diff --git a/engines/hdb/file-manager.cpp b/engines/hdb/file-manager.cpp index 0bc22fbb62..e58838d53d 100644 --- a/engines/hdb/file-manager.cpp +++ b/engines/hdb/file-manager.cpp @@ -31,6 +31,10 @@ FileMan::FileMan() { _mpcFile = new Common::File; } +FileMan::~FileMan() { + delete _mpcFile; +} + bool FileMan::openMPC(const Common::String &filename) { uint32 offset; diff --git a/engines/hdb/file-manager.h b/engines/hdb/file-manager.h index 740bf4d1b6..a83512eed7 100644 --- a/engines/hdb/file-manager.h +++ b/engines/hdb/file-manager.h @@ -64,6 +64,7 @@ private: public: FileMan(); + ~FileMan(); struct { uint32 id; diff --git a/engines/hdb/gfx.cpp b/engines/hdb/gfx.cpp index b497b53b05..54746c39d1 100644 --- a/engines/hdb/gfx.cpp +++ b/engines/hdb/gfx.cpp @@ -45,6 +45,8 @@ Gfx::~Gfx() { for (uint i = 0; i < _gfxCache->size(); i++) delete _gfxCache->operator[](i); delete _gfxCache; + for (uint i = 0; i < _charInfoBlocks.size(); i++) + delete _charInfoBlocks[i]; delete _sines; delete _cosines; for (int i = 0; i < _fontHeader.numChars; i++) diff --git a/engines/hdb/map.cpp b/engines/hdb/map.cpp index a17b0db1f1..66fc9ab570 100644 --- a/engines/hdb/map.cpp +++ b/engines/hdb/map.cpp @@ -41,6 +41,9 @@ Map::Map() { } Map::~Map() { + free(_mapExplosions); + free(_mapExpBarrels); + free(_mapLaserBeams); } void Map::save(Common::OutSaveFile *out) { |