summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-09-04 20:09:57 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-09-04 20:09:57 +0000
commitef36048760f80708ac1eaccbc2a21e7a700dc2ab (patch)
treeadf7bde9971d56e55cdf1bb88880ccecc0451e6f /src/map.cpp
parentfd3706906e3408b497c61dcc54294dee8e6dbaf7 (diff)
downloadmana-ef36048760f80708ac1eaccbc2a21e7a700dc2ab.tar.gz
mana-ef36048760f80708ac1eaccbc2a21e7a700dc2ab.tar.bz2
mana-ef36048760f80708ac1eaccbc2a21e7a700dc2ab.tar.xz
mana-ef36048760f80708ac1eaccbc2a21e7a700dc2ab.zip
Introduced another template to make deleting all values in a container easier.
Inspired by qDeleteAll() from Qt.
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 28d07022..888ea3a8 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -23,7 +23,6 @@
#include "map.h"
-#include <algorithm>
#include <queue>
#include <cassert>
@@ -161,13 +160,13 @@ Map::~Map()
{
// delete metadata, layers, tilesets and overlays
delete[] mMetaTiles;
- for (int i=0; i < NB_BLOCKTYPES; i++)
+ for (int i = 0; i < NB_BLOCKTYPES; i++)
{
delete[] mOccupation[i];
}
- for_each(mLayers.begin(), mLayers.end(), make_dtor(mLayers));
- for_each(mTilesets.begin(), mTilesets.end(), make_dtor(mTilesets));
- for_each(mOverlays.begin(), mOverlays.end(), make_dtor(mOverlays));
+ delete_all(mLayers);
+ delete_all(mTilesets);
+ delete_all(mOverlays);
}
void Map::initializeOverlays()