use dts::make_unique instead of new

develop
Stoyan Gaydarov 2018-07-08 16:10:01 -07:00
parent 6cfd987c0d
commit 699f864110
4 changed files with 8 additions and 4 deletions

@ -42,6 +42,7 @@ using namespace std;
#include "Core.h" #include "Core.h"
#include "DataDefs.h" #include "DataDefs.h"
#include "Console.h" #include "Console.h"
#include "MiscUtils.h"
#include "Module.h" #include "Module.h"
#include "VersionInfoFactory.h" #include "VersionInfoFactory.h"
#include "VersionInfo.h" #include "VersionInfo.h"
@ -1518,7 +1519,7 @@ Core::~Core()
} }
Core::Core() : Core::Core() :
d(new Private), d(dts::make_unique<Private>()),
script_path_mutex{}, script_path_mutex{},
HotkeyMutex{}, HotkeyMutex{},
HotkeyCond{}, HotkeyCond{},

@ -42,6 +42,7 @@ using namespace std;
#include <md5wrapper.h> #include <md5wrapper.h>
#include "MemAccess.h" #include "MemAccess.h"
#include "Memory.h" #include "Memory.h"
#include "MiscUtils.h"
#include "VersionInfoFactory.h" #include "VersionInfoFactory.h"
#include "VersionInfo.h" #include "VersionInfo.h"
#include "Error.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); const VersionInfo * vinfo = known_versions->getVersionInfoByMD5(my_md5);
if(vinfo) if(vinfo)
{ {
my_descriptor.reset(new VersionInfo(*vinfo)); my_descriptor = dts::make_unique<VersionInfo>(*vinfo);
identified = true; identified = true;
} }
else else

@ -40,6 +40,7 @@ using namespace std;
#include <md5wrapper.h> #include <md5wrapper.h>
#include "MemAccess.h" #include "MemAccess.h"
#include "Memory.h" #include "Memory.h"
#include "MiscUtils.h"
#include "VersionInfoFactory.h" #include "VersionInfoFactory.h"
#include "VersionInfo.h" #include "VersionInfo.h"
#include "Error.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); const VersionInfo * vinfo = known_versions->getVersionInfoByMD5(my_md5);
if(vinfo) if(vinfo)
{ {
my_descriptor.reset(new VersionInfo(*vinfo)); my_descriptor = dts::make_unique<VersionInfo>(*vinfo);
identified = true; identified = true;
} }
else else

@ -44,6 +44,7 @@ using namespace std;
#include "Error.h" #include "Error.h"
#include "MemAccess.h" #include "MemAccess.h"
#include "Memory.h" #include "Memory.h"
#include "MiscUtils.h"
using namespace DFHack; using namespace DFHack;
namespace DFHack namespace DFHack
{ {
@ -100,7 +101,7 @@ Process::Process(VersionInfoFactory * factory) : identified(false)
{ {
identified = true; identified = true;
// give the process a data model and memory layout fixed for the base of first module // 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<VersionInfo>(*vinfo);
my_descriptor->rebaseTo(getBase()); my_descriptor->rebaseTo(getBase());
} }
else else