diff --git a/src/corelib/kernel/qeventdispatcher_wasm_p.h b/src/corelib/kernel/qeventdispatcher_wasm_p.h index cf718a151b5..7b257e02ad1 100644 --- a/src/corelib/kernel/qeventdispatcher_wasm_p.h +++ b/src/corelib/kernel/qeventdispatcher_wasm_p.h @@ -55,7 +55,6 @@ public: void wakeUp() override; static void runOnMainThread(std::function fn); - static void runOnMainThreadAsync(std::function fn); static void socketSelect(int timeout, int socket, bool waitForRead, bool waitForWrite, bool *selectForRead, bool *selectForWrite, bool *socketDisconnect); @@ -98,6 +97,7 @@ private: static void run(std::function fn); static void runAsync(std::function fn); + static void runOnMainThreadAsync(std::function fn); static QEventDispatcherWasm *g_mainThreadEventDispatcher; diff --git a/src/network/access/qnetworkreplywasmimpl.cpp b/src/network/access/qnetworkreplywasmimpl.cpp index eb3e50dec86..d8190434ccf 100644 --- a/src/network/access/qnetworkreplywasmimpl.cpp +++ b/src/network/access/qnetworkreplywasmimpl.cpp @@ -9,7 +9,6 @@ #include #include #include -#include #include #include @@ -296,10 +295,7 @@ void QNetworkReplyWasmImplPrivate::doSendRequest() QByteArray destinationPath = dPath.toUtf8(); attr.destinationPath = destinationPath.constData(); - auto url = request.url().toString().toUtf8(); - QEventDispatcherWasm::runOnMainThread([attr, url]() mutable { - emscripten_fetch(&attr, url); - }); + m_fetch = emscripten_fetch(&attr, request.url().toString().toUtf8()); state = Working; } diff --git a/tests/auto/wasm/tst_fetchapi.cpp b/tests/auto/wasm/tst_fetchapi.cpp index d8d9a7971a7..3dcd8dd9165 100644 --- a/tests/auto/wasm/tst_fetchapi.cpp +++ b/tests/auto/wasm/tst_fetchapi.cpp @@ -69,6 +69,7 @@ void tst_FetchApi::sendRequestOnMainThread() void tst_FetchApi::sendRequestOnBackgroundThread() { + QSKIP("Skip this test until we fix fetching from background threads."); QEventLoop mainEventLoop; BackgroundThread *backgroundThread = new BackgroundThread(); connect(backgroundThread, &BackgroundThread::finished, &mainEventLoop, &QEventLoop::quit);