Skip to content

Commit fd363b4

Browse files
committed
Merge remote-tracking branch 'intorr/intorr_dev' into xd_dev
2 parents f2a6a3d + bd50031 commit fd363b4

File tree

8 files changed

+14
-11
lines changed

8 files changed

+14
-11
lines changed

src/xrCore/FileSystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "commdlg.h"
1010
#include "vfw.h"
1111

12-
EFS_Utils* xr_EFS = NULL;
12+
std::unique_ptr<EFS_Utils> xr_EFS;
1313
//----------------------------------------------------
1414
EFS_Utils::EFS_Utils() {}
1515
EFS_Utils::~EFS_Utils() {}

src/xrCore/FileSystem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class XRCORE_API EFS_Utils
4242
static xr_string ExtractFileExt(LPCSTR src);
4343
static xr_string ExcludeBasePath(LPCSTR full_path, LPCSTR excl_path);
4444
};
45-
extern XRCORE_API EFS_Utils* xr_EFS;
45+
extern XRCORE_API std::unique_ptr<EFS_Utils> xr_EFS;
4646
#define EFS (*xr_EFS)
4747

4848
#endif /*_INCDEF_FileSystem_H_*/

src/xrCore/LocatorAPI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
const u32 BIG_FILE_READER_WINDOW_SIZE = 1024 * 1024;
2121

22-
CLocatorAPI* xr_FS = nullptr;
22+
std::unique_ptr<CLocatorAPI> xr_FS;
2323

2424
#ifdef _EDITOR
2525
static constexpr pcstr FSLTX = "fs.ltx"

src/xrCore/LocatorAPI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,5 +212,5 @@ class XRCORE_API CLocatorAPI : Noncopyable
212212
void unlock_rescan();
213213
};
214214

215-
extern XRCORE_API CLocatorAPI* xr_FS;
215+
extern XRCORE_API std::unique_ptr<CLocatorAPI> xr_FS;
216216
#define FS (*xr_FS)

src/xrCore/cpuid.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ unsigned int query_processor_info(processor_info* pinfo)
4646
std::bitset<32> f_81_ECX;*/
4747
std::bitset<32> f_81_EDX;
4848

49-
std::vector<std::array<int, 4>> data;
49+
xr_vector<std::array<int, 4>> data;
5050
std::array<int, 4> cpui;
5151

5252
__cpuid(cpui.data(), 0);

src/xrCore/xrCore.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ void xrCore::Initialize(pcstr _ApplicationName, LogCallback cb, bool init_fs, pc
8282

8383
rtc_initialize();
8484

85-
xr_FS = new CLocatorAPI();
85+
xr_FS = std::make_unique<CLocatorAPI>();
8686

87-
xr_EFS = new EFS_Utils();
87+
xr_EFS = std::make_unique<EFS_Utils>();
8888
//. R_ASSERT (co_res==S_OK);
8989
}
9090
if (init_fs)
@@ -135,8 +135,8 @@ void xrCore::_destroy()
135135
ttapi.destroy();
136136
FS._destroy();
137137
EFS._destroy();
138-
xr_delete(xr_FS);
139-
xr_delete(xr_EFS);
138+
xr_FS.reset();
139+
xr_EFS.reset();
140140

141141
#ifndef _EDITOR
142142
if (trained_model)

src/xrEngine/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,6 @@ ENGINE_API int RunApplication()
281281

282282
Engine.External.Initialize();
283283
Startup();
284-
Core._destroy();
285284
// check for need to execute something external
286285
if (/*xr_strlen(g_sLaunchOnExit_params) && */ xr_strlen(g_sLaunchOnExit_app))
287286
{

src/xr_3da/entry_point.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ int entry_point(pcstr commandLine)
3535
}
3636
Core.Initialize("OpenXRay", nullptr, true, *fsgame ? fsgame : nullptr);
3737

38-
return RunApplication();
38+
auto result = RunApplication();
39+
40+
Core._destroy();
41+
42+
return result;
3943
}
4044

4145
int StackoverflowFilter(const int exceptionCode)

0 commit comments

Comments
 (0)