From 610c7da075789c1ae736c4a016ef822a4e500f29 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 26 Sep 2016 21:37:49 +0200 Subject: [PATCH] Plug memleaks in tst_QStackedLayout QLayout::replaceWidget() doesn't delete the affected item, but returns it. Change-Id: Ibda96e4bf2432ad13ed2908c7d37547f46e29a37 Reviewed-by: Friedemann Kleint --- tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp b/tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp index 835b6ca799..5be4846b3e 100644 --- a/tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp +++ b/tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp @@ -377,7 +377,7 @@ void tst_QStackedLayout::replaceWidget() QCOMPARE(stackLayout->indexOf(replaceFrom), 1); QCOMPARE(stackLayout->indexOf(replaceTo), -1); - stackLayout->replaceWidget(replaceFrom, replaceTo); + delete stackLayout->replaceWidget(replaceFrom, replaceTo); QCOMPARE(stackLayout->indexOf(replaceFrom), -1); QCOMPARE(stackLayout->indexOf(replaceTo), 1);