diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-08 19:13:26 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-08 19:13:26 +0000 |
commit | 405c23831a4e1363f26f848215c8140f6d6d9f78 (patch) | |
tree | edf8b8838f055a1b5d024a3976b49f5cddfa8c50 /src/flooritemmanager.cpp | |
parent | e645ad2a139c332937813dd2a1e5424ded182e26 (diff) | |
download | mana-405c23831a4e1363f26f848215c8140f6d6d9f78.tar.gz mana-405c23831a4e1363f26f848215c8140f6d6d9f78.tar.bz2 mana-405c23831a4e1363f26f848215c8140f6d6d9f78.tar.xz mana-405c23831a4e1363f26f848215c8140f6d6d9f78.zip |
Added a 'dtor' helper functor to delete objects in arrays and containers using STL algorithms.
Diffstat (limited to 'src/flooritemmanager.cpp')
-rw-r--r-- | src/flooritemmanager.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/flooritemmanager.cpp b/src/flooritemmanager.cpp index f87c925b..680616a8 100644 --- a/src/flooritemmanager.cpp +++ b/src/flooritemmanager.cpp @@ -25,6 +25,8 @@ #include "floor_item.h" +#include "utils/dtor.h" + FloorItemManager::~FloorItemManager() { clear(); @@ -46,11 +48,7 @@ void FloorItemManager::destroy(FloorItem *item) void FloorItemManager::clear() { - FloorItemIterator i; - for (i = mFloorItems.begin(); i != mFloorItems.end(); i++) - { - delete *i; - } + for_each(mFloorItems.begin(), mFloorItems.end(), make_dtor(mFloorItems)); mFloorItems.clear(); } |