Skip to content

Commit

Permalink
Merge remote-tracking branch 'intorr/intorr_dev' into xd_dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Mar 17, 2018
2 parents f2a6a3d + bd50031 commit fd363b4
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/xrCore/FileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "commdlg.h"
#include "vfw.h"

EFS_Utils* xr_EFS = NULL;
std::unique_ptr<EFS_Utils> xr_EFS;
//----------------------------------------------------
EFS_Utils::EFS_Utils() {}
EFS_Utils::~EFS_Utils() {}
Expand Down
2 changes: 1 addition & 1 deletion src/xrCore/FileSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class XRCORE_API EFS_Utils
static xr_string ExtractFileExt(LPCSTR src);
static xr_string ExcludeBasePath(LPCSTR full_path, LPCSTR excl_path);
};
extern XRCORE_API EFS_Utils* xr_EFS;
extern XRCORE_API std::unique_ptr<EFS_Utils> xr_EFS;
#define EFS (*xr_EFS)

#endif /*_INCDEF_FileSystem_H_*/
2 changes: 1 addition & 1 deletion src/xrCore/LocatorAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

const u32 BIG_FILE_READER_WINDOW_SIZE = 1024 * 1024;

CLocatorAPI* xr_FS = nullptr;
std::unique_ptr<CLocatorAPI> xr_FS;

#ifdef _EDITOR
static constexpr pcstr FSLTX = "fs.ltx"
Expand Down
2 changes: 1 addition & 1 deletion src/xrCore/LocatorAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,5 @@ class XRCORE_API CLocatorAPI : Noncopyable
void unlock_rescan();
};

extern XRCORE_API CLocatorAPI* xr_FS;
extern XRCORE_API std::unique_ptr<CLocatorAPI> xr_FS;
#define FS (*xr_FS)
2 changes: 1 addition & 1 deletion src/xrCore/cpuid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ unsigned int query_processor_info(processor_info* pinfo)
std::bitset<32> f_81_ECX;*/
std::bitset<32> f_81_EDX;

std::vector<std::array<int, 4>> data;
xr_vector<std::array<int, 4>> data;
std::array<int, 4> cpui;

__cpuid(cpui.data(), 0);
Expand Down
8 changes: 4 additions & 4 deletions src/xrCore/xrCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ void xrCore::Initialize(pcstr _ApplicationName, LogCallback cb, bool init_fs, pc

rtc_initialize();

xr_FS = new CLocatorAPI();
xr_FS = std::make_unique<CLocatorAPI>();

xr_EFS = new EFS_Utils();
xr_EFS = std::make_unique<EFS_Utils>();
//. R_ASSERT (co_res==S_OK);
}
if (init_fs)
Expand Down Expand Up @@ -135,8 +135,8 @@ void xrCore::_destroy()
ttapi.destroy();
FS._destroy();
EFS._destroy();
xr_delete(xr_FS);
xr_delete(xr_EFS);
xr_FS.reset();
xr_EFS.reset();

#ifndef _EDITOR
if (trained_model)
Expand Down
1 change: 0 additions & 1 deletion src/xrEngine/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ ENGINE_API int RunApplication()

Engine.External.Initialize();
Startup();
Core._destroy();
// check for need to execute something external
if (/*xr_strlen(g_sLaunchOnExit_params) && */ xr_strlen(g_sLaunchOnExit_app))
{
Expand Down
6 changes: 5 additions & 1 deletion src/xr_3da/entry_point.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ int entry_point(pcstr commandLine)
}
Core.Initialize("OpenXRay", nullptr, true, *fsgame ? fsgame : nullptr);

return RunApplication();
auto result = RunApplication();

Core._destroy();

return result;
}

int StackoverflowFilter(const int exceptionCode)
Expand Down

0 comments on commit fd363b4

Please sign in to comment.