From 25e19a66f165835816034d61e98801312b91a4a3 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 24 Oct 2013 15:37:18 +0200 Subject: rift: fix crash with no device Signed-off-by: Stanislaw Halik --- ftnoir_tracker_rift/ftnoir_tracker_rift.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'ftnoir_tracker_rift') diff --git a/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp b/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp index 7fade51c..965e849b 100644 --- a/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp +++ b/ftnoir_tracker_rift/ftnoir_tracker_rift.cpp @@ -25,10 +25,14 @@ Rift_Tracker::Rift_Tracker() Rift_Tracker::~Rift_Tracker() { - pSensor->Release(); - delete pSFusion; - pHMD->Release(); - pManager->Release(); + if (pSensor) + pSensor->Release(); + if (pSFusion) + delete pSFusion; + if (pHMD) + pHMD->Release(); + if (pManager) + pManager->Release(); System::Destroy(); } @@ -36,7 +40,6 @@ Rift_Tracker::~Rift_Tracker() void Rift_Tracker::StartTracker(QFrame* videoFrame) { - loadSettings(); // // Startup the Oculus SDK device handling, use the first Rift sensor we find. -- cgit v1.2.3