From c034089fa697e6dc22f04b3209768a9dc1abcb9c Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Mon, 17 Feb 2020 11:08:30 +1000 Subject: wasm: do not try to resume main thread if mainloop has not started yet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit d928beb024c240b37d35d2c53f25648c99a484b4) Fixes: QTBUG-83293 Change-Id: Ibd891629d1d023e47d196dd60821cc5c583a178d Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/wasm/qwasmeventdispatcher.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/wasm') diff --git a/src/plugins/platforms/wasm/qwasmeventdispatcher.cpp b/src/plugins/platforms/wasm/qwasmeventdispatcher.cpp index ca8db9b215..2e1b083557 100644 --- a/src/plugins/platforms/wasm/qwasmeventdispatcher.cpp +++ b/src/plugins/platforms/wasm/qwasmeventdispatcher.cpp @@ -194,7 +194,8 @@ void QWasmEventDispatcher::wakeUp() { #ifdef EMSCRIPTEN_HAS_ASYNC_RUN_IN_MAIN_RUNTIME_THREAD if (!emscripten_is_main_runtime_thread()) - emscripten_async_run_in_main_runtime_thread_(EM_FUNC_SIG_VI, (void*)(&QWasmEventDispatcher::mainThreadWakeUp), this); + if (m_hasMainLoop) + emscripten_async_run_in_main_runtime_thread_(EM_FUNC_SIG_VI, (void*)(&QWasmEventDispatcher::mainThreadWakeUp), this); #endif QEventDispatcherUNIX::wakeUp(); } -- cgit v1.2.3