diff options
author | Eugene Sandulenko | 2016-12-12 23:35:32 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2016-12-12 23:35:32 +0100 |
commit | c5e55878ad68b26babcc5ca654cf39488df102ec (patch) | |
tree | 59820d055865df908793a241460937e8d6a77ad7 /engines/fullpipe | |
parent | 9075cbc1ba9d01833e9ec94d53eba5cdd81abed2 (diff) | |
download | scummvm-rg350-c5e55878ad68b26babcc5ca654cf39488df102ec.tar.gz scummvm-rg350-c5e55878ad68b26babcc5ca654cf39488df102ec.tar.bz2 scummvm-rg350-c5e55878ad68b26babcc5ca654cf39488df102ec.zip |
FULLPIPE: Plug more memory leaks
Diffstat (limited to 'engines/fullpipe')
-rw-r--r-- | engines/fullpipe/gameloader.cpp | 13 | ||||
-rw-r--r-- | engines/fullpipe/gameloader.h | 1 | ||||
-rw-r--r-- | engines/fullpipe/gfx.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/motion.cpp | 5 | ||||
-rw-r--r-- | engines/fullpipe/motion.h | 1 | ||||
-rw-r--r-- | engines/fullpipe/statics.cpp | 2 |
6 files changed, 23 insertions, 1 deletions
diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp index aebf73dbe4..2d7dc31510 100644 --- a/engines/fullpipe/gameloader.cpp +++ b/engines/fullpipe/gameloader.cpp @@ -617,6 +617,19 @@ Sc2::Sc2() { _entranceDataCount = 0; } +Sc2::~Sc2() { + delete _motionController; + free(_data1); + + for (int i = 0; i < _defPicAniInfosCount; i++) + delete _defPicAniInfos[i]; + free(_defPicAniInfos); + + for (int i = 0; i < _entranceDataCount; i++) + delete _entranceData[i]; + free(_entranceData); +} + bool Sc2::load(MfcArchive &file) { debugC(5, kDebugLoading, "Sc2::load()"); diff --git a/engines/fullpipe/gameloader.h b/engines/fullpipe/gameloader.h index a6c2416aae..52811d8624 100644 --- a/engines/fullpipe/gameloader.h +++ b/engines/fullpipe/gameloader.h @@ -57,6 +57,7 @@ class Sc2 : public CObject { public: Sc2(); + virtual ~Sc2(); virtual bool load(MfcArchive &file); }; diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp index 466f123ef8..0f9ac80e1e 100644 --- a/engines/fullpipe/gfx.cpp +++ b/engines/fullpipe/gfx.cpp @@ -483,7 +483,7 @@ void Picture::freePicture() { if (_bitmap) { if (testFlags() && !_field_54) { freeData(); - //free(_bitmap); + delete _bitmap; _bitmap = 0; } } diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index 05f13d4a8b..13fe8d03c1 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -105,6 +105,11 @@ MovGraphLink *MotionController::getLinkByName(const char *name) { return 0; } +MctlCompound::~MctlCompound() { + for (uint i = 0; i < _motionControllers.size(); i++) + delete _motionControllers[i]; +} + bool MctlCompound::load(MfcArchive &file) { debugC(5, kDebugLoading, "MctlCompound::load()"); diff --git a/engines/fullpipe/motion.h b/engines/fullpipe/motion.h index 4eecd98536..d1c5901807 100644 --- a/engines/fullpipe/motion.h +++ b/engines/fullpipe/motion.h @@ -106,6 +106,7 @@ public: MctlCompoundArray _motionControllers; MctlCompound() { _objtype = kObjTypeMctlCompound; } + virtual ~MctlCompound(); virtual bool load(MfcArchive &file); diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index 7f43fa0b1d..cc94f543de 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -154,6 +154,8 @@ StaticANIObject::~StaticANIObject() { _staticsList.clear(); + freeMovementsPixelData(); + for (uint i = 0; i < _movements.size(); i++) delete _movements[i]; |