Plug memleaks in tst_QStackedLayout

QLayout::replaceWidget() doesn't delete the affected item, but returns it.

Change-Id: Ibda96e4bf2432ad13ed2908c7d37547f46e29a37
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Marc Mutz 2016-09-26 21:37:49 +02:00
parent 67f11a3199
commit 610c7da075

View File

@ -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);