From a6fc77ec65561f9f0768322b618f6ceac21f1efc Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Thu, 16 Nov 2017 12:16:26 -0600 Subject: FULLPIPE: Clarify ownership of pointer arrays in StaticANIObject --- engines/fullpipe/statics.cpp | 12 ++---------- engines/fullpipe/statics.h | 2 ++ 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'engines') diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp index c1daea0c64..a85b90b595 100644 --- a/engines/fullpipe/statics.cpp +++ b/engines/fullpipe/statics.cpp @@ -112,16 +112,8 @@ StaticANIObject::StaticANIObject() { } StaticANIObject::~StaticANIObject() { - for (uint i = 0; i < _staticsList.size(); i++) - delete _staticsList[i]; - - _staticsList.clear(); - - for (uint i = 0; i < _movements.size(); i++) - delete _movements[i]; - - _movements.clear(); - + Common::for_each(_staticsList.begin(), _staticsList.end(), Common::DefaultDeleter()); + Common::for_each(_movements.begin(), _movements.end(), Common::DefaultDeleter()); g_fp->_aniHandler->detachAllObjects(); } diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h index 124a293722..ab5ba67616 100644 --- a/engines/fullpipe/statics.h +++ b/engines/fullpipe/statics.h @@ -177,7 +177,9 @@ class StaticANIObject : public GameObject { int _initialCounter; void (*_callback1)(int, Common::Point *point, int, int); void (*_callback2)(int *); + /** items in list are owned */ Common::Array _movements; + /** items in list are owned */ Common::Array _staticsList; StepArray _stepArray; int16 _field_96; -- cgit v1.2.3