From ec84df81e0bcfd7b9676462ad5122ebf3c5e1b61 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Fri, 16 Feb 2018 10:53:30 +0100 Subject: [PATCH] WebPage: Return early from acceptNavigationRequest when closing app QtWebEngine is calling this method from qAddPostRoutine function and it sometimes crashes there in tests on exit. --- src/lib/webengine/webpage.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/webengine/webpage.cpp b/src/lib/webengine/webpage.cpp index c9238b343..93b3fb281 100644 --- a/src/lib/webengine/webpage.cpp +++ b/src/lib/webengine/webpage.cpp @@ -397,6 +397,10 @@ void WebPage::setupWebChannelForUrl(const QUrl &url) bool WebPage::acceptNavigationRequest(const QUrl &url, QWebEnginePage::NavigationType type, bool isMainFrame) { + if (mApp->isClosing()) { + return QWebEnginePage::acceptNavigationRequest(url, type, isMainFrame); + } + if (!mApp->plugins()->acceptNavigationRequest(this, url, type, isMainFrame)) return false;