wasm: Dont access QNetworkReply header data through dangling pointer
Fixes: QTBUG-122893 Change-Id: I3768fdffaec7be4ec0b559fdb365600220e648d1 Reviewed-by: Lorn Potter <lorn.potter@gmail.com> (cherry picked from commit a5b00cefef12999e9a213943855abe6bc0ab5365) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 9a59f6bc574e3b9dfa09ac33e6dd951f105f87bb) Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io> (cherry picked from commit 8341bfd960a09576f95ebabb1e9ad767e85198b1)
This commit is contained in:
parent
2287723ed3
commit
afdec88505
@ -52,6 +52,7 @@ public:
|
||||
void interrupt() override;
|
||||
void wakeUp() override;
|
||||
|
||||
static void runOnMainThread(std::function<void(void)> fn);
|
||||
static void runOnMainThreadAsync(std::function<void(void)> fn);
|
||||
static void socketSelect(int timeout, int socket, bool waitForRead, bool waitForWrite,
|
||||
bool *selectForRead, bool *selectForWrite, bool *socketDisconnect);
|
||||
@ -89,7 +90,6 @@ private:
|
||||
|
||||
static void run(std::function<void(void)> fn);
|
||||
static void runAsync(std::function<void(void)> fn);
|
||||
static void runOnMainThread(std::function<void(void)> fn);
|
||||
|
||||
static QEventDispatcherWasm *g_mainThreadEventDispatcher;
|
||||
|
||||
|
@ -297,7 +297,7 @@ void QNetworkReplyWasmImplPrivate::doSendRequest()
|
||||
attr.destinationPath = destinationPath.constData();
|
||||
|
||||
auto url = request.url().toString().toUtf8();
|
||||
QEventDispatcherWasm::runOnMainThreadAsync([attr, url]() mutable {
|
||||
QEventDispatcherWasm::runOnMainThread([attr, url]() mutable {
|
||||
emscripten_fetch(&attr, url);
|
||||
});
|
||||
state = Working;
|
||||
|
Loading…
x
Reference in New Issue
Block a user