From 405c23831a4e1363f26f848215c8140f6d6d9f78 Mon Sep 17 00:00:00 2001 From: Björn Steinbrink Date: Wed, 8 Mar 2006 19:13:26 +0000 Subject: Added a 'dtor' helper functor to delete objects in arrays and containers using STL algorithms. --- src/main.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 4013cbec..eba01d0f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -77,6 +77,8 @@ #include "resources/image.h" #include "resources/resourcemanager.h" +#include "utils/dtor.h" + // Account infos char n_server, n_character; @@ -319,11 +321,7 @@ void exit_engine() config.write(); delete gui; delete graphics; - //delete hairset; - for (unsigned int i = 0; i < hairset.size(); i++) - { - delete hairset[i]; - } + for_each(hairset.begin(), hairset.end(), make_dtor(hairset)); hairset.clear(); delete playerset; -- cgit v1.2.3-70-g09d2