From a68cab0a8608fc387ea85eb751a641fa41d61183 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Mon, 11 May 2015 15:19:31 -0500 Subject: [PATCH] Don't need to stick the global in a unique_ptr to avoid hang, apparently. --- driver_osvr.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/driver_osvr.cpp b/driver_osvr.cpp index d21e9ca..cda12fa 100644 --- a/driver_osvr.cpp +++ b/driver_osvr.cpp @@ -85,7 +85,7 @@ class CDriver_OSVR : public vr::IHmdDriverProvider std::unique_ptr client_; }; -std::unique_ptr g_driverOSVR; +static CDriver_OSVR g_driverOSVR; vr::HmdError CDriver_OSVR::Init(const char* pchUserConfigDir, const char* pchDriverInstallDir) { @@ -106,7 +106,6 @@ void CDriver_OSVR::Cleanup() client_.reset(); hmds_.clear(); context_.reset(); - g_driverOSVR.reset(); } uint32_t CDriver_OSVR::GetHmdCount() @@ -147,7 +146,5 @@ OSVR_DLL_EXPORT void* HmdDriverFactory(const char* pInterfaceName, int* pReturnC return NULL; } - g_driverOSVR = std::make_unique(); - - return g_driverOSVR.get(); + return &g_driverOSVR; }