diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/fullpipe/statics.cpp | 12 | ||||
-rw-r--r-- | engines/fullpipe/statics.h | 2 |
2 files changed, 4 insertions, 10 deletions
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<Statics>()); + Common::for_each(_movements.begin(), _movements.end(), Common::DefaultDeleter<Movement>()); 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<Movement *> _movements; + /** items in list are owned */ Common::Array<Statics *> _staticsList; StepArray _stepArray; int16 _field_96; |