diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2021-09-29 14:18:27 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2021-09-30 11:58:34 +0000 |
commit | 8d8448a1f5a935f72ae5206df5ce95c651db1fbc (patch) | |
tree | c77b0fc5a0b928016d849b78d9e7326ddbddfcb1 /src/corelib/kernel | |
parent | 8d6e825ddfa14f75959ae20a76e4e1a34f4faec2 (diff) |
wasm: limit exec() workarounds to the main thread
This fixes a bug where calling exec() on a secondary
thread would make the thread exit.
Task-number: QTBUG-94344
Pick-to: 6.2
Change-Id: I259c7ebbd53271609af88aca141d88c282cbcd34
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qeventdispatcher_wasm.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_wasm.cpp b/src/corelib/kernel/qeventdispatcher_wasm.cpp index 7632b2ca55..f5c2802aa6 100644 --- a/src/corelib/kernel/qeventdispatcher_wasm.cpp +++ b/src/corelib/kernel/qeventdispatcher_wasm.cpp @@ -206,10 +206,12 @@ bool QEventDispatcherWasm::processEvents(QEventLoop::ProcessEventsFlags flags) qCDebug(lcEventDispatcher) << "QEventDispatcherWasm::processEvents flags" << flags << "pending events" << hasPendingEvents; - if (flags & QEventLoop::DialogExec) - handleDialogExec(); - else if (flags & QEventLoop::EventLoopExec) - handleEventLoopExec(); + if (isMainThreadEventDispatcher()) { + if (flags & QEventLoop::DialogExec) + handleDialogExec(); + else if (flags & QEventLoop::EventLoopExec) + handleEventLoopExec(); + } if (!(flags & QEventLoop::ExcludeUserInputEvents)) pollForNativeEvents(); |