From 01b80e4f56cc9f5120a9a34690e6f593006e5585 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 22 Mar 2019 01:46:05 +0100 Subject: dinput: move locking to init function --- dinput/dinput.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dinput/dinput.cpp') 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(); } -- cgit v1.2.3