Skip to content

Commit

Permalink
Don't need to stick the global in a unique_ptr to avoid hang, apparen…
Browse files Browse the repository at this point in the history
…tly.
  • Loading branch information
rpavlik committed May 11, 2015
1 parent 2587cea commit a68cab0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions driver_osvr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class CDriver_OSVR : public vr::IHmdDriverProvider
std::unique_ptr<ClientMainloopThread> client_;
};

std::unique_ptr<CDriver_OSVR> g_driverOSVR;
static CDriver_OSVR g_driverOSVR;

vr::HmdError CDriver_OSVR::Init(const char* pchUserConfigDir, const char* pchDriverInstallDir)
{
Expand All @@ -106,7 +106,6 @@ void CDriver_OSVR::Cleanup()
client_.reset();
hmds_.clear();
context_.reset();
g_driverOSVR.reset();
}

uint32_t CDriver_OSVR::GetHmdCount()
Expand Down Expand Up @@ -147,7 +146,5 @@ OSVR_DLL_EXPORT void* HmdDriverFactory(const char* pInterfaceName, int* pReturnC
return NULL;
}

g_driverOSVR = std::make_unique<CDriver_OSVR>();

return g_driverOSVR.get();
return &g_driverOSVR;
}

0 comments on commit a68cab0

Please sign in to comment.