diff options
author | Colin Snover | 2017-11-16 12:16:26 -0600 |
---|---|---|
committer | Eugene Sandulenko | 2017-11-18 22:35:12 +0100 |
commit | a6fc77ec65561f9f0768322b618f6ceac21f1efc (patch) | |
tree | 9b09df967449ea694ac7beea8e3de3e3cb9b126f /engines | |
parent | 4cc64c4139903c9a6b769855ab2a8a8125beb644 (diff) | |
download | scummvm-rg350-a6fc77ec65561f9f0768322b618f6ceac21f1efc.tar.gz scummvm-rg350-a6fc77ec65561f9f0768322b618f6ceac21f1efc.tar.bz2 scummvm-rg350-a6fc77ec65561f9f0768322b618f6ceac21f1efc.zip |
FULLPIPE: Clarify ownership of pointer arrays in StaticANIObject
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; |