diff options
Diffstat (limited to 'engines/sherlock')
-rw-r--r-- | engines/sherlock/objects.cpp | 2 | ||||
-rw-r--r-- | engines/sherlock/scene.cpp | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/engines/sherlock/objects.cpp b/engines/sherlock/objects.cpp index 3dc50e61b1..3cec0d800a 100644 --- a/engines/sherlock/objects.cpp +++ b/engines/sherlock/objects.cpp @@ -719,6 +719,8 @@ bool Object::checkEndOfSequence() { // Free the images delete _images; + _images = nullptr; + _imageFrame = nullptr; } } else { _type = INVALID; diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp index ec7831820a..a9763a7fc5 100644 --- a/engines/sherlock/scene.cpp +++ b/engines/sherlock/scene.cpp @@ -1050,6 +1050,12 @@ int Scene::startCAnim(int cAnimNum, int playRate) { // Set canim to REMOVE type and free memory cObj.checkObject(); + for (uint idx = 0; idx < _canimShapes.size(); ++idx) { + if (&_canimShapes[idx] == &cObj) { + _canimShapes.remove_at(idx); + break; + } + } if (gotoCode > 0 && !talk._talkToAbort) { _goToScene = gotoCode; @@ -1376,7 +1382,7 @@ void Scene::doBgAnim() { if (_goToScene == -1) screen.slamArea(o._position.x, o._position.y, o._delta.x, o._delta.y); - _canimShapes.remove_at(idx); + _canimShapes[idx]._type = INVALID; if (_ongoingCans > 0) --_ongoingCans; } else if (o._type == ACTIVE_BG_SHAPE) { |