diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2020-02-26 14:52:47 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2020-02-27 10:11:30 (GMT) |
commit | 557cecdc3d9ace51229b3dfce4a2ed71c2cc5c5c (patch) | |
tree | 656e2b8567e3c12c115bd1922f6bddb43c18a811 /Source/cmSourceGroup.cxx | |
parent | ab2d170c746d7cb68c39e9577cdaabc66668c0aa (diff) | |
download | CMake-557cecdc3d9ace51229b3dfce4a2ed71c2cc5c5c.zip CMake-557cecdc3d9ace51229b3dfce4a2ed71c2cc5c5c.tar.gz CMake-557cecdc3d9ace51229b3dfce4a2ed71c2cc5c5c.tar.bz2 |
Modernize memory management
Update internals of various classes
Diffstat (limited to 'Source/cmSourceGroup.cxx')
-rw-r--r-- | Source/cmSourceGroup.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/cmSourceGroup.cxx b/Source/cmSourceGroup.cxx index 8c3ec9f..155068cb 100644 --- a/Source/cmSourceGroup.cxx +++ b/Source/cmSourceGroup.cxx @@ -4,6 +4,8 @@ #include <utility> +#include <cm/memory> + #include "cmStringAlgorithms.h" class cmSourceGroupInternals @@ -16,7 +18,7 @@ cmSourceGroup::cmSourceGroup(std::string name, const char* regex, const char* parentName) : Name(std::move(name)) { - this->Internal = new cmSourceGroupInternals; + this->Internal = cm::make_unique<cmSourceGroupInternals>(); this->SetGroupRegex(regex); if (parentName) { this->FullName = cmStrCat(parentName, '\\'); @@ -24,10 +26,7 @@ cmSourceGroup::cmSourceGroup(std::string name, const char* regex, this->FullName += this->Name; } -cmSourceGroup::~cmSourceGroup() -{ - delete this->Internal; -} +cmSourceGroup::~cmSourceGroup() = default; cmSourceGroup::cmSourceGroup(cmSourceGroup const& r) { @@ -36,7 +35,7 @@ cmSourceGroup::cmSourceGroup(cmSourceGroup const& r) this->GroupRegex = r.GroupRegex; this->GroupFiles = r.GroupFiles; this->SourceFiles = r.SourceFiles; - this->Internal = new cmSourceGroupInternals(*r.Internal); + this->Internal = cm::make_unique<cmSourceGroupInternals>(*r.Internal); } cmSourceGroup& cmSourceGroup::operator=(cmSourceGroup const& r) |