From 7fdc9a8b5f63f645b5aedede4fd18e0c1d1c39c5 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 2 Aug 2015 11:41:48 +0200 Subject: [PATCH] QtAutogen: Use a smart pointer. --- Source/cmQtAutoGenerators.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 9cb005c31..9803c0173 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -1218,7 +1218,7 @@ bool cmQtAutoGenerators::Run(const std::string& targetDirectory, cmGlobalGenerator gg(&cm); cmState::Snapshot snapshot = cm.GetCurrentSnapshot(); - cmLocalGenerator* lg = gg.CreateLocalGenerator(snapshot); + cmsys::auto_ptr lg(gg.CreateLocalGenerator(snapshot)); lg->GetMakefile()->SetCurrentBinaryDirectory(targetDirectory); lg->GetMakefile()->SetCurrentSourceDirectory(targetDirectory); gg.SetCurrentMakefile(lg->GetMakefile()); @@ -1235,7 +1235,6 @@ bool cmQtAutoGenerators::Run(const std::string& targetDirectory, this->WriteOldMocDefinitionsFile(targetDirectory); - delete lg; return success; }