Skip to content

Commit

Permalink
FULLPIPE: Plug more memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Dec 12, 2016
1 parent 9075cbc commit c5e5587
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 1 deletion.
13 changes: 13 additions & 0 deletions engines/fullpipe/gameloader.cpp
Expand Up @@ -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()");

Expand Down
1 change: 1 addition & 0 deletions engines/fullpipe/gameloader.h
Expand Up @@ -57,6 +57,7 @@ class Sc2 : public CObject {

public:
Sc2();
virtual ~Sc2();
virtual bool load(MfcArchive &file);
};

Expand Down
2 changes: 1 addition & 1 deletion engines/fullpipe/gfx.cpp
Expand Up @@ -483,7 +483,7 @@ void Picture::freePicture() {
if (_bitmap) {
if (testFlags() && !_field_54) {
freeData();
//free(_bitmap);
delete _bitmap;
_bitmap = 0;
}
}
Expand Down
5 changes: 5 additions & 0 deletions engines/fullpipe/motion.cpp
Expand Up @@ -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()");

Expand Down
1 change: 1 addition & 0 deletions engines/fullpipe/motion.h
Expand Up @@ -106,6 +106,7 @@ class MctlCompound : public MotionController {
MctlCompoundArray _motionControllers;

MctlCompound() { _objtype = kObjTypeMctlCompound; }
virtual ~MctlCompound();

virtual bool load(MfcArchive &file);

Expand Down
2 changes: 2 additions & 0 deletions engines/fullpipe/statics.cpp
Expand Up @@ -154,6 +154,8 @@ StaticANIObject::~StaticANIObject() {

_staticsList.clear();

freeMovementsPixelData();

for (uint i = 0; i < _movements.size(); i++)
delete _movements[i];

Expand Down

0 comments on commit c5e5587

Please sign in to comment.