summaryrefslogtreecommitdiff
path: root/Source/cmWhileCommand.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2019-07-12 12:15:21 +0200
committerSebastian Holtermann <sebholt@xwmw.org>2019-07-17 14:58:27 +0200
commit3bed969dace917e5bf551c6783da425f5e2217c7 (patch)
treec5dc37940f62022d52518e2d73ecaf6d5cc5ceda /Source/cmWhileCommand.cxx
parentfaacb90a13f87d32aaf3e5c45cfd48af7e84b733 (diff)
downloadcmake-3bed969dace917e5bf551c6783da425f5e2217c7.tar.gz
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 31a878dd4d..a902964eff 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;
}