diff --git a/src/corelib/kernel/qeventdispatcher_wasm_p.h b/src/corelib/kernel/qeventdispatcher_wasm_p.h index 09231e0d4c4..b486d1f1f70 100644 --- a/src/corelib/kernel/qeventdispatcher_wasm_p.h +++ b/src/corelib/kernel/qeventdispatcher_wasm_p.h @@ -54,7 +54,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); protected: @@ -91,6 +90,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; }