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:
parent
67f11a3199
commit
610c7da075
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user