From 7a0e239240ceb58230a11b64fe8c8a63d6854c30 Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Thu, 4 May 2017 22:09:30 +0200 Subject: cmFileMonitor: use cmDeleteAll --- Source/cmFileMonitor.cxx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Source/cmFileMonitor.cxx b/Source/cmFileMonitor.cxx index ed794c3..499ee84 100644 --- a/Source/cmFileMonitor.cxx +++ b/Source/cmFileMonitor.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmFileMonitor.h" +#include "cmAlgorithms.h" #include "cmsys/SystemTools.hxx" #include @@ -36,12 +37,7 @@ public: class cmVirtualDirectoryWatcher : public cmIBaseWatcher { public: - ~cmVirtualDirectoryWatcher() override - { - for (auto i : this->Children) { - delete i.second; - } - } + ~cmVirtualDirectoryWatcher() override { cmDeleteAll(this->Children); } cmIBaseWatcher* Find(const std::string& ps) { @@ -102,9 +98,7 @@ public: void Reset() { - for (auto c : this->Children) { - delete c.second; - } + cmDeleteAll(this->Children); this->Children.clear(); } -- cgit v0.12