summaryrefslogtreecommitdiff
path: root/src/beingmanager.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-03-08 19:13:26 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-03-08 19:13:26 +0000
commit405c23831a4e1363f26f848215c8140f6d6d9f78 (patch)
treeedf8b8838f055a1b5d024a3976b49f5cddfa8c50 /src/beingmanager.cpp
parente645ad2a139c332937813dd2a1e5424ded182e26 (diff)
downloadmana-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/beingmanager.cpp')
-rw-r--r--src/beingmanager.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/beingmanager.cpp b/src/beingmanager.cpp
index c7edc82b..c5890048 100644
--- a/src/beingmanager.cpp
+++ b/src/beingmanager.cpp
@@ -31,6 +31,8 @@
#include "net/messageout.h"
#include "net/protocol.h"
+#include "utils/dtor.h"
+
class FindBeingFunctor
{
public:
@@ -148,11 +150,7 @@ void BeingManager::clear()
mBeings.remove(player_node);
}
- for (BeingIterator i = mBeings.begin(); i != mBeings.end(); i++)
- {
- delete (*i);
- }
-
+ for_each(mBeings.begin(), mBeings.end(), make_dtor(mBeings));
mBeings.clear();
if (player_node)