From 686c44a69b13f6e884dd2b6d9991f4cd94597c5a Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 28 Sep 2016 10:49:57 +0200 Subject: Plug remaining leaks in tests/auto/widgets/kernel The usual: - delete return values of QLayout::takeAt(), replaceWidget() - delete styles - delete top-level widgets - delete actions Either by naked delete, QScopedPointer or allocation on the stack instead of the heap. This fixes the remaining errors in GCC 6.1 Linux ASan runs of tests/auto/widgets/kernel. Change-Id: I8cc217be114b2e0edf34ad8d60dbf722f900bb7f Reviewed-by: Thiago Macieira --- tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp') diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index 87a189fc87..424069c8ae 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -2211,8 +2211,8 @@ void tst_QApplication::noQuitOnHide() { int argc = 0; QApplication app(argc, 0); - QWidget *window1 = new NoQuitOnHideWidget; - window1->show(); + NoQuitOnHideWidget window1; + window1.show(); QCOMPARE(app.exec(), 1); } @@ -2246,12 +2246,12 @@ void tst_QApplication::abortQuitOnShow() { int argc = 0; QApplication app(argc, 0); - QWidget *window1 = new ShowCloseShowWidget(false); - window1->show(); + ShowCloseShowWidget window1(false); + window1.show(); QCOMPARE(app.exec(), 0); - QWidget *window2 = new ShowCloseShowWidget(true); - window2->show(); + ShowCloseShowWidget window2(true); + window2.show(); QCOMPARE(app.exec(), 1); } -- cgit v1.2.3