From c9a624f398dafb397f75a8682145e1d412bfc100 Mon Sep 17 00:00:00 2001
From: Peter Varga <pvarga@inf.u-szeged.hu>
Date: Thu, 27 Jul 2017 13:46:42 +0200
Subject: [PATCH] Fix demobrowser to not crash when switching to private
 browsing mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Old QWebEnginePage is destructed by the QWebEngineView::setPage() call.
No need to destruct it explicitly.

Task-number: QTBUG-62147
Change-Id: I8ec33d5df618f69e4acf1667490df4a67dad9a16
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
---
 examples/webenginewidgets/demobrowser/webview.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/examples/webenginewidgets/demobrowser/webview.cpp b/examples/webenginewidgets/demobrowser/webview.cpp
index 498df74fc..ce273c0f6 100644
--- a/examples/webenginewidgets/demobrowser/webview.cpp
+++ b/examples/webenginewidgets/demobrowser/webview.cpp
@@ -341,8 +341,6 @@ WebView::WebView(QWidget* parent)
 
 void WebView::setPage(WebPage *_page)
 {
-    if (m_page)
-        m_page->deleteLater();
     m_page = _page;
     QWebEngineView::setPage(_page);
 #if defined(QWEBENGINEPAGE_STATUSBARMESSAGE)
-- 
GitLab