summaryrefslogtreecommitdiff
path: root/src/resources
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/resources
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/resources')
-rw-r--r--src/resources/imageset.cpp4
-rw-r--r--src/resources/itemdb.cpp3
-rw-r--r--src/resources/monsterinfo.cpp4
3 files changed, 3 insertions, 8 deletions
diff --git a/src/resources/imageset.cpp b/src/resources/imageset.cpp
index 5618abfa..04faf0a3 100644
--- a/src/resources/imageset.cpp
+++ b/src/resources/imageset.cpp
@@ -21,8 +21,6 @@
* $Id$
*/
-#include <algorithm>
-
#include "imageset.h"
#include "../log.h"
@@ -46,7 +44,7 @@ ImageSet::ImageSet(Image *img, int width, int height)
ImageSet::~ImageSet()
{
- for_each(mImages.begin(), mImages.end(), make_dtor(mImages));
+ delete_all(mImages);
}
Image*
diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp
index ada9482f..202f4ba7 100644
--- a/src/resources/itemdb.cpp
+++ b/src/resources/itemdb.cpp
@@ -21,7 +21,6 @@
* $Id$
*/
-#include <algorithm>
#include <cassert>
#include <libxml/tree.h>
@@ -196,7 +195,7 @@ void ItemDB::unload()
delete mUnknown;
mUnknown = NULL;
- for_each(mItemInfos.begin(), mItemInfos.end(), make_dtor(mItemInfos));
+ delete_all(mItemInfos);
mItemInfos.clear();
mLoaded = false;
}
diff --git a/src/resources/monsterinfo.cpp b/src/resources/monsterinfo.cpp
index 0af09c53..263810de 100644
--- a/src/resources/monsterinfo.cpp
+++ b/src/resources/monsterinfo.cpp
@@ -21,8 +21,6 @@
* $Id$
*/
-#include <algorithm>
-
#include "monsterinfo.h"
#include "../utils/dtor.h"
@@ -35,7 +33,7 @@ MonsterInfo::MonsterInfo():
MonsterInfo::~MonsterInfo()
{
// kill vectors in mSoundEffects
- for_each(mSounds.begin(), mSounds.end(), make_dtor(mSounds));
+ delete_all(mSounds);
mSounds.clear();
}