summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/kernel/qapplication
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-09-28 10:49:57 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-10-21 21:48:26 +0000
commit686c44a69b13f6e884dd2b6d9991f4cd94597c5a (patch)
treefbf54691477474ef9c918636c34619a78188872b /tests/auto/widgets/kernel/qapplication
parentf773ddd026a6227cdb754dea4a5fe0a25137033f (diff)
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 <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/widgets/kernel/qapplication')
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp12
1 files changed, 6 insertions, 6 deletions
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);
}