diff options
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(); } |