diff options
author | Lorn Potter <lorn.potter@gmail.com> | 2020-10-27 14:32:12 +1000 |
---|---|---|
committer | Lorn Potter <lorn.potter@gmail.com> | 2021-06-05 07:08:21 +1000 |
commit | 75b0e8d59999d91f1828e464166f6ad829d74d7b (patch) | |
tree | 7d80765ce1893620e447666a781f9734ca51b9fd /src/gui/text/qtexthtmlparser.cpp | |
parent | 107a8058aec8712f228569ac5f0ed5db30318e53 (diff) |
wasm: fix network crash on abort
Also work around emscripten bug #8238
emcripten_fetch_close() does not abort the network
request, but instead just free’s the emscripten_fetch_t
object. onsuccess or onerror will still be called, but
now with a stale pointer to the deleted emscripten_fetch_t
object.
See https://github.com/emscripten-core/emscripten/issues/8234
Work around this by setting the userData to null when
we want to abort or are done with the request. The
onerror and onsuccess callbacks can then check this
field (on the the still valid emscripten_fetch_t), and
bail out on the (from the Qt side) aborted request.
Call emcripten_fetch_close() from on error and onsuccess;
this should be the point when the emscripten request
is done, and there will be no more callbacks.
Pick-to: 5.15
Fixes: QTBUG-87813
Change-Id: Ie9b8a29037eb150c23741683588b0f0bfd5d8c63
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/gui/text/qtexthtmlparser.cpp')
0 files changed, 0 insertions, 0 deletions