Prevent crashes in openvr on shutdown

By ensuring that there is an opengl context is bound before calling VR_Shutdown()
This commit is contained in:
Anthony J. Thibault 2016-10-11 16:36:29 -07:00
parent abb05bc686
commit 973ee544fb
2 changed files with 3 additions and 1 deletions

View file

@ -445,8 +445,9 @@ void OpenVrDisplayPlugin::internalDeactivate() {
_openVrDisplayActive = false;
_container->setIsOptionChecked(StandingHMDSensorMode, false);
if (_system) {
// Invalidate poses. It's fine if someone else sets these shared values, but we're about to stop updating them, and
// TODO: Invalidate poses. It's fine if someone else sets these shared values, but we're about to stop updating them, and
// we don't want ViveControllerManager to consider old values to be valid.
_container->makeRenderingContextCurrent();
releaseOpenVrSystem();
_system = nullptr;
}

View file

@ -132,6 +132,7 @@ void ViveControllerManager::deactivate() {
_container->removeMenu(MENU_PATH);
if (_system) {
_container->makeRenderingContextCurrent();
releaseOpenVrSystem();
_system = nullptr;
}