From 1ea018db1d0a146bcbb9e2eb0ad52c693e9a452a Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Wed, 26 Oct 2016 17:40:34 -0700 Subject: [PATCH] Fix for crash in openvr on startup pluginActivate can fail and return false, when steamvr is in a "Not Ready" state. In practice this can occur on a botched steamvr install, or when the vr compositor process is unable to start. When pluginActivate returns false, there's some sort of race condition where pluginUpdate will still be called. But it's only reproducible in release builds, without the debugger attached. This commit prevents pluginUpdate from crashing by making sure that the openvr _system ptr is valid first. --- plugins/openvr/src/ViveControllerManager.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp index 2d2720e388..ff8fc64474 100644 --- a/plugins/openvr/src/ViveControllerManager.cpp +++ b/plugins/openvr/src/ViveControllerManager.cpp @@ -210,6 +210,11 @@ void ViveControllerManager::renderHand(const controller::Pose& pose, gpu::Batch& void ViveControllerManager::pluginUpdate(float deltaTime, const controller::InputCalibrationData& inputCalibrationData) { + + if (!_system) { + return; + } + auto userInputMapper = DependencyManager::get(); handleOpenVrEvents(); if (openVrQuitRequested()) {