From c69bceeb40ce7d8fb3f8bc12332a3eb3c96887d1 Mon Sep 17 00:00:00 2001
From: Florian Bruhin <git@the-compiler.org>
Date: Tue, 28 Mar 2017 08:21:46 +0200
Subject: [PATCH] Set WA_DeleteOnClose in contentmanipulation example

Otherwise, the MainWindow and QWebEngineView remains on the heap when closing
the application.

Task-number: QTBUG-59765
Change-Id: Ia643d1e919ca5f0a1d9405ba9b7ab72aabd8c051
Reviewed-by: Viktor Engelmann <viktor.engelmann@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 examples/webenginewidgets/contentmanipulation/mainwindow.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/examples/webenginewidgets/contentmanipulation/mainwindow.cpp b/examples/webenginewidgets/contentmanipulation/mainwindow.cpp
index 3198f0908..74d647c69 100644
--- a/examples/webenginewidgets/contentmanipulation/mainwindow.cpp
+++ b/examples/webenginewidgets/contentmanipulation/mainwindow.cpp
@@ -70,6 +70,7 @@ InvokeWrapper<Arg, R, C> invoke(R *receiver, void (C::*memberFun)(Arg))
 
 MainWindow::MainWindow(const QUrl& url)
 {
+    setAttribute(Qt::WA_DeleteOnClose, true);
     progress = 0;
 
     QFile file;
-- 
GitLab