Ninja,Makefile: use unique_ptr for memory management

Use a `unique_ptr` to manage the lifetime of the `MacOSXContentGenerator`
and 'OSXBundleGenerator` rather than manually handling the lifetime.
This commit is contained in:
Saleem Abdulrasool
2019-04-13 13:01:49 -07:00
committed by Brad King
parent d38d7747fe
commit 9ecb3f8d5c
7 changed files with 21 additions and 30 deletions
@@ -9,6 +9,7 @@
#include <utility>
#include <vector>
#include "cmAlgorithms.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalUnixMakefileGenerator3.h"
@@ -35,14 +36,12 @@ cmMakefileExecutableTargetGenerator::cmMakefileExecutableTargetGenerator(
this->GeneratorTarget->GetExecutableNames(this->ConfigName);
this->OSXBundleGenerator =
new cmOSXBundleGenerator(target, this->ConfigName);
cm::make_unique<cmOSXBundleGenerator>(target, this->ConfigName);
this->OSXBundleGenerator->SetMacContentFolders(&this->MacContentFolders);
}
cmMakefileExecutableTargetGenerator::~cmMakefileExecutableTargetGenerator()
{
delete this->OSXBundleGenerator;
}
cmMakefileExecutableTargetGenerator::~cmMakefileExecutableTargetGenerator() =
default;
void cmMakefileExecutableTargetGenerator::WriteRuleFiles()
{