wasm: Fix UB in QEventDispatcher
Calling std::mutex::try_lock() when the mutex is already owned by the thread casuses undefined behavior. Change-Id: I024ced271cad8a034bebf80b48e31e7e7461c560 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This commit is contained in:
parent
1e7fa7dbe8
commit
82a9ecb175
@ -271,7 +271,6 @@ bool QEventDispatcherWasm::isValidEventDispatcherPointer(QEventDispatcherWasm *e
|
|||||||
if (eventDispatcher == g_mainThreadEventDispatcher)
|
if (eventDispatcher == g_mainThreadEventDispatcher)
|
||||||
return true;
|
return true;
|
||||||
#if QT_CONFIG(thread)
|
#if QT_CONFIG(thread)
|
||||||
Q_ASSERT(!g_staticDataMutex.try_lock()); // caller must lock mutex
|
|
||||||
if (g_secondaryThreadEventDispatchers.contains(eventDispatcher))
|
if (g_secondaryThreadEventDispatchers.contains(eventDispatcher))
|
||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user