summaryrefslogtreecommitdiffhomepage
path: root/tracker-joystick/ftnoir_tracker_joystick.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-11-19 01:42:40 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-11-19 01:42:40 +0100
commit411d85cf66d89696ba51f5bc44d92322613e2e9f (patch)
tree2a0c061b6e08bbe2b9b5cfbb2e9a117140881575 /tracker-joystick/ftnoir_tracker_joystick.cpp
parent42217bbb858ddb158ad13777e2aace942aaf9525 (diff)
tracker/joystick: avoid recursive acquire of non-recursive mutex
Diffstat (limited to 'tracker-joystick/ftnoir_tracker_joystick.cpp')
-rw-r--r--tracker-joystick/ftnoir_tracker_joystick.cpp21
1 files changed, 12 insertions, 9 deletions
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);
}