summaryrefslogtreecommitdiffstats
path: root/Source/cmWhileCommand.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2019-07-12 10:15:21 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2019-07-17 12:58:27 (GMT)
commit3bed969dace917e5bf551c6783da425f5e2217c7 (patch)
treec5dc37940f62022d52518e2d73ecaf6d5cc5ceda /Source/cmWhileCommand.cxx
parentfaacb90a13f87d32aaf3e5c45cfd48af7e84b733 (diff)
downloadCMake-3bed969dace917e5bf551c6783da425f5e2217c7.zip
CMake-3bed969dace917e5bf551c6783da425f5e2217c7.tar.gz
CMake-3bed969dace917e5bf551c6783da425f5e2217c7.tar.bz2
cmMakefile: Modernize AddFunctionBlocker method to accept a std::unique_ptr
Diffstat (limited to 'Source/cmWhileCommand.cxx')
-rw-r--r--Source/cmWhileCommand.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx
index 31a878d..a902964 100644
--- a/Source/cmWhileCommand.cxx
+++ b/Source/cmWhileCommand.cxx
@@ -2,6 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmWhileCommand.h"
+#include "cm_memory.hxx"
+
#include "cmConditionEvaluator.h"
#include "cmExecutionStatus.h"
#include "cmExpandedCommandArgument.h"
@@ -9,6 +11,8 @@
#include "cmMessageType.h"
#include "cmSystemTools.h"
+#include <utility>
+
cmWhileFunctionBlocker::cmWhileFunctionBlocker(cmMakefile* mf)
: Makefile(mf)
, Depth(0)
@@ -134,9 +138,10 @@ bool cmWhileCommand::InvokeInitialPass(
}
// create a function blocker
- cmWhileFunctionBlocker* f = new cmWhileFunctionBlocker(this->Makefile);
- f->Args = args;
- this->Makefile->AddFunctionBlocker(f);
-
+ {
+ auto fb = cm::make_unique<cmWhileFunctionBlocker>(this->Makefile);
+ fb->Args = args;
+ this->Makefile->AddFunctionBlocker(std::move(fb));
+ }
return true;
}