Merge pull request #14728 from SamGondelman/crash

Case 20411: Fix crash on subsequent entitlements checks
This commit is contained in:
Adam Smith 2019-01-23 14:42:00 -08:00 committed by GitHub
commit 04f33956e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -82,15 +82,18 @@ private:
} }
#ifdef OCULUS_APP_ID #ifdef OCULUS_APP_ID
if (qApp->property(hifi::properties::OCULUS_STORE).toBool()) { static std::once_flag once;
if (ovr_PlatformInitializeWindows(OCULUS_APP_ID) != ovrPlatformInitialize_Success) { std::call_once(once, []() {
qCWarning(oculusLog) << "Unable to initialize the platform for entitlement check - fail the check" << ovr::getError(); if (qApp->property(hifi::properties::OCULUS_STORE).toBool()) {
return; if (ovr_PlatformInitializeWindows(OCULUS_APP_ID) != ovrPlatformInitialize_Success) {
} else { qCWarning(oculusLog) << "Unable to initialize the platform for entitlement check - fail the check" << ovr::getError();
qCDebug(oculusLog) << "Performing Oculus Platform entitlement check"; return;
ovr_Entitlement_GetIsViewerEntitled(); } else {
qCDebug(oculusLog) << "Performing Oculus Platform entitlement check";
ovr_Entitlement_GetIsViewerEntitled();
}
} }
} });
#endif #endif
ovrGraphicsLuid luid; ovrGraphicsLuid luid;