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.
This commit is contained in:
Anthony J. Thibault 2016-10-26 17:40:34 -07:00
parent d25a4fb1cb
commit 1ea018db1d

View file

@ -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<controller::UserInputMapper>();
handleOpenVrEvents();
if (openVrQuitRequested()) {