diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2020-03-02 09:41:17 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-03-05 12:34:01 (GMT) |
commit | 9de0355d4f8f56a71f3d18b1b2c3d50dc8624aae (patch) | |
tree | ec6050654d073ec970e81fe51d95cf0110d02efd /Source/QtDialog/QCMake.cxx | |
parent | 07a7bc0e3fc370eaa5593cffcd07c0ea739cfc9c (diff) | |
download | CMake-9de0355d4f8f56a71f3d18b1b2c3d50dc8624aae.zip CMake-9de0355d4f8f56a71f3d18b1b2c3d50dc8624aae.tar.gz CMake-9de0355d4f8f56a71f3d18b1b2c3d50dc8624aae.tar.bz2 |
Modernize memory management
Update internals of various classes.
Diffstat (limited to 'Source/QtDialog/QCMake.cxx')
-rw-r--r-- | Source/QtDialog/QCMake.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 3b5dc04..c3e9c84 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -2,6 +2,8 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "QCMake.h" +#include <cm/memory> + #include <QCoreApplication> #include <QDir> @@ -35,7 +37,8 @@ QCMake::QCMake(QObject* p) cmSystemTools::SetStderrCallback( [this](std::string const& msg) { this->stderrCallback(msg); }); - this->CMakeInstance = new cmake(cmake::RoleProject, cmState::Project); + this->CMakeInstance = + cm::make_unique<cmake>(cmake::RoleProject, cmState::Project); this->CMakeInstance->SetCMakeEditCommand( cmSystemTools::GetCMakeGUICommand()); this->CMakeInstance->SetProgressCallback( @@ -55,11 +58,7 @@ QCMake::QCMake(QObject* p) } } -QCMake::~QCMake() -{ - delete this->CMakeInstance; - // cmDynamicLoader::FlushCache(); -} +QCMake::~QCMake() = default; void QCMake::loadCache(const QString& dir) { |