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:
Piotr Wierciński 2023-10-19 13:04:14 +02:00
parent 1e7fa7dbe8
commit 82a9ecb175

View File

@ -271,7 +271,6 @@ bool QEventDispatcherWasm::isValidEventDispatcherPointer(QEventDispatcherWasm *e
if (eventDispatcher == g_mainThreadEventDispatcher)
return true;
#if QT_CONFIG(thread)
Q_ASSERT(!g_staticDataMutex.try_lock()); // caller must lock mutex
if (g_secondaryThreadEventDispatchers.contains(eventDispatcher))
return true;
#endif