From 9f48a139cc695ccb3bac784e38fec586be0abda8 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Fri, 23 Jun 2017 18:37:48 +1200 Subject: [PATCH] Fix crash when enable Leap Motion --- plugins/hifiLeapMotion/src/LeapMotionPlugin.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/plugins/hifiLeapMotion/src/LeapMotionPlugin.cpp b/plugins/hifiLeapMotion/src/LeapMotionPlugin.cpp index 2139da6ce6..174dd02426 100644 --- a/plugins/hifiLeapMotion/src/LeapMotionPlugin.cpp +++ b/plugins/hifiLeapMotion/src/LeapMotionPlugin.cpp @@ -365,20 +365,14 @@ void LeapMotionPlugin::init() { bool LeapMotionPlugin::activate() { InputPlugin::activate(); - if (_enabled) { - // Nothing required to be done to start up Leap Motion. + // Nothing required to be done to start up Leap Motion library. - auto userInputMapper = DependencyManager::get(); - userInputMapper->registerDevice(_inputDevice); + _joints.resize(LeapMotionJointIndex::Size, { glm::vec3(), glm::quat() }); - if (_joints.size() != LeapMotionJointIndex::Size) { - _joints.resize(LeapMotionJointIndex::Size, { glm::vec3(), glm::quat() }); - } + auto userInputMapper = DependencyManager::get(); + userInputMapper->registerDevice(_inputDevice); - return true; - } - - return false; + return true; } void LeapMotionPlugin::deactivate() {