diff options
author | Eugene Sandulenko | 2016-12-12 23:50:24 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2016-12-12 23:50:24 +0100 |
commit | 1373e9b6a0c7ce3ee4c15eedef173a4a049d5f6c (patch) | |
tree | f979ba72b6ca230e8abf431c02b4d680753119f8 /engines/fullpipe | |
parent | ae7147c6c4918f719df4e343970501375eb58694 (diff) | |
download | scummvm-rg350-1373e9b6a0c7ce3ee4c15eedef173a4a049d5f6c.tar.gz scummvm-rg350-1373e9b6a0c7ce3ee4c15eedef173a4a049d5f6c.tar.bz2 scummvm-rg350-1373e9b6a0c7ce3ee4c15eedef173a4a049d5f6c.zip |
FULLPIPE: Avoid double free on memory cleanup
Diffstat (limited to 'engines/fullpipe')
-rw-r--r-- | engines/fullpipe/gameloader.cpp | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp index 2d7dc31510..28e5f370ff 100644 --- a/engines/fullpipe/gameloader.cpp +++ b/engines/fullpipe/gameloader.cpp @@ -85,23 +85,6 @@ GameLoader::~GameLoader() { g_fp->_gameLoader = 0; - for (uint i = 0; i < _sc2array.size(); i++) { - if (_sc2array[i]._defPicAniInfos) - free(_sc2array[i]._defPicAniInfos); - - if (_sc2array[i]._picAniInfos) - free(_sc2array[i]._picAniInfos); - - if (_sc2array[i]._motionController) - delete _sc2array[i]._motionController; - - if (_sc2array[i]._data1) - free(_sc2array[i]._data1); - - if (_sc2array[i]._entranceData) - free(_sc2array[i]._entranceData); - } - delete _gameVar; _gameVar = 0; @@ -628,6 +611,10 @@ Sc2::~Sc2() { for (int i = 0; i < _entranceDataCount; i++) delete _entranceData[i]; free(_entranceData); + + for (uint i = 0; i < _picAniInfosCount; i++) + delete _picAniInfos[i]; + free(_picAniInfos); } bool Sc2::load(MfcArchive &file) { |