diff options
-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(); } |