diff options
author | Szabolcs David <davidsz@inf.u-szeged.hu> | 2020-02-10 17:28:11 +0100 |
---|---|---|
committer | Szabolcs David <davidsz@inf.u-szeged.hu> | 2020-02-20 14:19:17 +0100 |
commit | d7a7663c58fa81b04b2acc63c3e672fce2f46116 (patch) | |
tree | a109a527b44c6f3b63c9021acf6f52473adb483c | |
parent | 2f56fd4a6b9b6f806334ba64b3689151a78d1d90 (diff) |
Fix crashes in urlChanged signal handlers
If a user initiates page load from a urlChanged signal handler
after a failed navigation while still being in
NavigationRequest::OnRequestFailedInternal(), the new page load can
discard the pending navigation entry and delete the NavigationRequest
instance before finishing execution of OnRequestFailedInternal().
Fix crash by returning to the event loop before emitting
urlChanged signal.
Task-number: QTBUG-78490
Change-Id: I849a609f5524d715769079f6c5cabf8db6b45944
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
-rw-r--r-- | src/webengine/api/qquickwebengineview.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp index 8097689ad..60aaead67 100644 --- a/src/webengine/api/qquickwebengineview.cpp +++ b/src/webengine/api/qquickwebengineview.cpp @@ -356,7 +356,9 @@ void QQuickWebEngineViewPrivate::urlChanged(const QUrl &url) { Q_Q(QQuickWebEngineView); Q_UNUSED(url); - Q_EMIT q->urlChanged(); + QTimer::singleShot(0, q, [q]() { + Q_EMIT q->urlChanged(); + }); } void QQuickWebEngineViewPrivate::iconChanged(const QUrl &url) |