Skip to content

Commit d7a7663

Browse files
committed
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 <[email protected]>
1 parent 2f56fd4 commit d7a7663

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/webengine/api/qquickwebengineview.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,9 @@ void QQuickWebEngineViewPrivate::urlChanged(const QUrl &url)
356356
{
357357
Q_Q(QQuickWebEngineView);
358358
Q_UNUSED(url);
359-
Q_EMIT q->urlChanged();
359+
QTimer::singleShot(0, q, [q]() {
360+
Q_EMIT q->urlChanged();
361+
});
360362
}
361363

362364
void QQuickWebEngineViewPrivate::iconChanged(const QUrl &url)

0 commit comments

Comments
 (0)