diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-03-22 01:46:05 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-03-28 08:13:12 +0100 |
commit | 01b80e4f56cc9f5120a9a34690e6f593006e5585 (patch) | |
tree | d4751ec5b62252ba0b6204b3ef5c55cfefabe5e6 /dinput/dinput.cpp | |
parent | 00e4e3f8d006653034147c1904601726f6bc2b1a (diff) |
dinput: move locking to init function
Diffstat (limited to 'dinput/dinput.cpp')
-rw-r--r-- | dinput/dinput.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dinput/dinput.cpp b/dinput/dinput.cpp index 02b56683..3bbeb34b 100644 --- a/dinput/dinput.cpp +++ b/dinput/dinput.cpp @@ -13,6 +13,8 @@ QMutex di_t::lock; diptr di_t::init_di() { + QMutexLocker l(&lock); + CoInitialize(nullptr); if (!handle) @@ -23,13 +25,11 @@ diptr di_t::init_di() diptr di_t::operator->() const { - QMutexLocker l(&lock); return init_di(); } di_t::operator bool() const { - QMutexLocker l(&lock); return !!init_di(); } |