Skip to content

Commit a2f671e

Browse files
committed
Revive: Protect from redundant initialization.
1 parent 5b671c3 commit a2f671e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Revive/REV_CAPI.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ ovrResult rev_InitErrorToOvrError(vr::EVRInitError error)
6060

6161
OVR_PUBLIC_FUNCTION(ovrResult) ovr_Initialize(const ovrInitParams* params)
6262
{
63+
if (g_InitError == vr::VRInitError_None)
64+
return ovrSuccess;
65+
6366
MicroProfileOnThreadCreate("Main");
6467
MicroProfileSetForceEnable(true);
6568
MicroProfileSetEnableAllGroups(true);
@@ -93,6 +96,7 @@ OVR_PUBLIC_FUNCTION(void) ovr_Shutdown()
9396
g_Sessions.clear();
9497
vr::VR_Shutdown();
9598
MicroProfileShutdown();
99+
g_InitError = vr::VRInitError_Init_NotInitialized;
96100
}
97101

98102
OVR_PUBLIC_FUNCTION(void) ovr_GetLastErrorInfo(ovrErrorInfo* errorInfo)

0 commit comments

Comments
 (0)