summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJüri Valdmann <juri.valdmann@qt.io>2018-10-31 16:32:59 +0100
committerJani Heikkinen <jani.heikkinen@qt.io>2018-11-02 05:12:54 +0000
commit335414d721c2c8748a48b074b2616503bdeeacf5 (patch)
treee329ab82050b92a2a1fde1e67da38fb7dd9788fb
parent9ad3c7aa8c8cd2917191b0b90d048d7d8fcebab5 (diff)
Fix quicknanobrowser crash on exit
Fixes: QTBUG-71513 Change-Id: If3dfa048cfce57a1f10fa7bde3e7892e00fc8fa9 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
-rw-r--r--src/webengine/api/qquickwebengineview.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index 39901e69..3bc0be19 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -166,6 +166,9 @@ QQuickWebEngineViewPrivate::~QQuickWebEngineViewPrivate()
adapter->stopFinding();
if (faviconProvider)
faviconProvider->detach(q_ptr);
+ // q_ptr->d_ptr might be null due to destroy()
+ if (q_ptr->d_ptr)
+ bindViewAndWidget(q_ptr, nullptr);
}
void QQuickWebEngineViewPrivate::initializeProfile()
@@ -188,10 +191,11 @@ bool QQuickWebEngineViewPrivate::profileInitialized() const
void QQuickWebEngineViewPrivate::destroy()
{
- // the profile for this web contens is about to be
- // garbage collected, delete WebContent first and
- // let the QQuickWebEngineView be collected later by gc.
- delete q_ptr->d_ptr.take();
+ // The profile for this web contents is about to be
+ // garbage collected, delete WebContents first and
+ // let the QQuickWebEngineView be collected later by gc.
+ bindViewAndWidget(q_ptr, nullptr);
+ delete q_ptr->d_ptr.take();
}
UIDelegatesManager *QQuickWebEngineViewPrivate::ui()