tst_QGraphicsLinearLayout: fix memleak in testStretch()
QGraphicsView, being a QWidget, needs to have a parent or be manually deleted. The test function did neither, so leaked the view. Fix by allocating it on the stack. Amends 913ff732004c2c61c39bcdd82ff05ea1827f328b. Pick-to: 6.9 6.8 6.5 5.15 Change-Id: If012d4b833849285b62e2a4b4089457c2aef1d88 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
This commit is contained in:
parent
f3a02fe39d
commit
9bab38b133
@ -1165,8 +1165,7 @@ void tst_QGraphicsLinearLayout::setStretchFactor()
|
||||
void tst_QGraphicsLinearLayout::testStretch()
|
||||
{
|
||||
QGraphicsScene scene;
|
||||
QGraphicsView *view = new QGraphicsView(&scene);
|
||||
Q_UNUSED(view);
|
||||
QGraphicsView view(&scene);
|
||||
QGraphicsWidget *form = new QGraphicsWidget(0, Qt::Window);
|
||||
|
||||
scene.addItem(form);
|
||||
|
Loading…
x
Reference in New Issue
Block a user