diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-08 19:13:26 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-08 19:13:26 +0000 |
commit | 405c23831a4e1363f26f848215c8140f6d6d9f78 (patch) | |
tree | edf8b8838f055a1b5d024a3976b49f5cddfa8c50 /src/gui/skill.cpp | |
parent | e645ad2a139c332937813dd2a1e5424ded182e26 (diff) | |
download | mana-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/gui/skill.cpp')
-rw-r--r-- | src/gui/skill.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gui/skill.cpp b/src/gui/skill.cpp index ba117b67..f86d2356 100644 --- a/src/gui/skill.cpp +++ b/src/gui/skill.cpp @@ -30,8 +30,10 @@ #include "scrollarea.h" #include "../localplayer.h" - #include "../graphics.h" + +#include "../utils/dtor.h" + extern Graphics *graphics; const char *skill_db[] = { @@ -193,9 +195,6 @@ void SkillDialog::setSkill(int id, int lvl, int mp) void SkillDialog::cleanList() { - for (int i = skillList.size() - 1; i >= 0; i--) - { - delete skillList[i]; - } + for_each(skillList.begin(), skillList.end(), make_dtor(skillList)); skillList.clear(); } |