summaryrefslogtreecommitdiffstats
path: root/Source/cmExternalMakefileProjectGenerator.h
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2020-01-02 16:07:09 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2020-01-07 10:03:11 (GMT)
commita00960288bedb3cd9495222e7917c9a1092ce4c9 (patch)
tree03843ce4517050e051c1a225912841c5dabb8174 /Source/cmExternalMakefileProjectGenerator.h
parente353d8bd9bfd90396089e514d5b77f027ac27e99 (diff)
downloadCMake-a00960288bedb3cd9495222e7917c9a1092ce4c9.zip
CMake-a00960288bedb3cd9495222e7917c9a1092ce4c9.tar.gz
CMake-a00960288bedb3cd9495222e7917c9a1092ce4c9.tar.bz2
GlobalGenerator family: modernize memory management
Diffstat (limited to 'Source/cmExternalMakefileProjectGenerator.h')
-rw-r--r--Source/cmExternalMakefileProjectGenerator.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/cmExternalMakefileProjectGenerator.h b/Source/cmExternalMakefileProjectGenerator.h
index a472a06..2b8d505 100644
--- a/Source/cmExternalMakefileProjectGenerator.h
+++ b/Source/cmExternalMakefileProjectGenerator.h
@@ -5,6 +5,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <memory>
#include <string>
#include <vector>
@@ -78,7 +79,7 @@ public:
std::vector<std::string> GetSupportedGlobalGenerators() const;
std::vector<std::string> Aliases;
- virtual cmExternalMakefileProjectGenerator*
+ virtual std::unique_ptr<cmExternalMakefileProjectGenerator>
CreateExternalMakefileProjectGenerator() const = 0;
void AddSupportedGlobalGenerator(const std::string& base);
@@ -100,10 +101,10 @@ public:
{
}
- cmExternalMakefileProjectGenerator* CreateExternalMakefileProjectGenerator()
- const override
+ std::unique_ptr<cmExternalMakefileProjectGenerator>
+ CreateExternalMakefileProjectGenerator() const override
{
- T* p = new T;
+ std::unique_ptr<cmExternalMakefileProjectGenerator> p(new T);
p->SetName(GetName());
return p;
}