From a96d1fdd51a5544bab52e5dbf176d31865f0542a Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Tue, 9 Jan 2018 16:15:43 +0100 Subject: Fix random crashes on exit Destroy WebContentsDelegateQt before WebContents, since it references already partly deleted WebContentsAdapterClient object. This prevents calls by navigation handling on already destructed web contents adapter client. Task-number: QTBUG-65647 Task-number: QTBUG-47945 Change-Id: I0ed5887b337a43ab89ecbfe05130691b5f1f37ec Reviewed-by: Allan Sandfeld Jensen --- src/core/web_contents_delegate_qt.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/core/web_contents_delegate_qt.cpp') diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index f51a6dff3..db05fae4b 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -109,6 +109,13 @@ WebContentsDelegateQt::WebContentsDelegateQt(content::WebContents *webContents, Observe(webContents); } +WebContentsDelegateQt::~WebContentsDelegateQt() +{ + // The destruction of this object should take place before + // WebContents destruction since WebContentsAdapterClient + // might be already deleted. +} + content::WebContents *WebContentsDelegateQt::OpenURLFromTab(content::WebContents *source, const content::OpenURLParams ¶ms) { content::WebContents *target = source; -- cgit v1.2.3