From 411d85cf66d89696ba51f5bc44d92322613e2e9f Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 19 Nov 2015 01:42:40 +0100 Subject: tracker/joystick: avoid recursive acquire of non-recursive mutex --- tracker-joystick/ftnoir_tracker_joystick.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'tracker-joystick') diff --git a/tracker-joystick/ftnoir_tracker_joystick.cpp b/tracker-joystick/ftnoir_tracker_joystick.cpp index 77fd7241..742ce972 100644 --- a/tracker-joystick/ftnoir_tracker_joystick.cpp +++ b/tracker-joystick/ftnoir_tracker_joystick.cpp @@ -19,17 +19,20 @@ FTNoIR_Tracker::FTNoIR_Tracker() : void FTNoIR_Tracker::reload() { s.b->reload(); - QMutexLocker foo(&mtx); - if (g_pJoystick) { - g_pJoystick->Unacquire(); - g_pJoystick->Release(); + QMutexLocker foo(&mtx); + + if (g_pJoystick) + { + g_pJoystick->Unacquire(); + g_pJoystick->Release(); + } + if (g_pDI) + g_pDI->Release(); + + g_pJoystick = nullptr; + g_pDI = nullptr; } - if (g_pDI) - g_pDI->Release(); - - g_pJoystick = nullptr; - g_pDI = nullptr; start_tracker(frame); } -- cgit v1.2.3