From 699f864110c17ecc0fde36474aa950f175e0f535 Mon Sep 17 00:00:00 2001 From: Stoyan Gaydarov Date: Sun, 8 Jul 2018 16:10:01 -0700 Subject: [PATCH] use dts::make_unique instead of new --- library/Core.cpp | 3 ++- library/Process-darwin.cpp | 3 ++- library/Process-linux.cpp | 3 ++- library/Process-windows.cpp | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/library/Core.cpp b/library/Core.cpp index d4db9bb08..e18b03140 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -42,6 +42,7 @@ using namespace std; #include "Core.h" #include "DataDefs.h" #include "Console.h" +#include "MiscUtils.h" #include "Module.h" #include "VersionInfoFactory.h" #include "VersionInfo.h" @@ -1518,7 +1519,7 @@ Core::~Core() } Core::Core() : - d(new Private), + d(dts::make_unique()), script_path_mutex{}, HotkeyMutex{}, HotkeyCond{}, diff --git a/library/Process-darwin.cpp b/library/Process-darwin.cpp index 614432584..13657ca17 100644 --- a/library/Process-darwin.cpp +++ b/library/Process-darwin.cpp @@ -42,6 +42,7 @@ using namespace std; #include #include "MemAccess.h" #include "Memory.h" +#include "MiscUtils.h" #include "VersionInfoFactory.h" #include "VersionInfo.h" #include "Error.h" @@ -69,7 +70,7 @@ Process::Process(VersionInfoFactory * known_versions) : identified(false), my_pe const VersionInfo * vinfo = known_versions->getVersionInfoByMD5(my_md5); if(vinfo) { - my_descriptor.reset(new VersionInfo(*vinfo)); + my_descriptor = dts::make_unique(*vinfo); identified = true; } else diff --git a/library/Process-linux.cpp b/library/Process-linux.cpp index 37e55865e..c5dea6b46 100644 --- a/library/Process-linux.cpp +++ b/library/Process-linux.cpp @@ -40,6 +40,7 @@ using namespace std; #include #include "MemAccess.h" #include "Memory.h" +#include "MiscUtils.h" #include "VersionInfoFactory.h" #include "VersionInfo.h" #include "Error.h" @@ -73,7 +74,7 @@ Process::Process(VersionInfoFactory * known_versions) : identified(false), my_pe const VersionInfo * vinfo = known_versions->getVersionInfoByMD5(my_md5); if(vinfo) { - my_descriptor.reset(new VersionInfo(*vinfo)); + my_descriptor = dts::make_unique(*vinfo); identified = true; } else diff --git a/library/Process-windows.cpp b/library/Process-windows.cpp index a45afa619..eee7c4feb 100644 --- a/library/Process-windows.cpp +++ b/library/Process-windows.cpp @@ -44,6 +44,7 @@ using namespace std; #include "Error.h" #include "MemAccess.h" #include "Memory.h" +#include "MiscUtils.h" using namespace DFHack; namespace DFHack { @@ -100,7 +101,7 @@ Process::Process(VersionInfoFactory * factory) : identified(false) { identified = true; // give the process a data model and memory layout fixed for the base of first module - my_descriptor.reset(new VersionInfo(*vinfo)); + my_descriptor = dts::make_unique(*vinfo); my_descriptor->rebaseTo(getBase()); } else