tst_QGraphicsWidget: fix memleak in qgraphicswidget()
The QGraphicsWidget `parent` didn't have a parent itself, and the test function neglected to delete the object manually, leaking it. To fix, allocate it on the stack. Amends the start of the public history. Pick-to: 6.9 6.8 6.5 5.15 Change-Id: Ie9814655c1a52b6dc0d15076eca591fe710d51ae Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
This commit is contained in:
parent
235fe36de7
commit
76e76afb83
@ -289,8 +289,8 @@ void tst_QGraphicsWidget::qgraphicswidget()
|
||||
QCOMPARE(widget.call_propertyChange(QString(), QVariant()), QVariant());
|
||||
widget.call_sizeHint(Qt::PreferredSize, QSizeF());
|
||||
|
||||
QGraphicsWidget *parent = new QGraphicsWidget;
|
||||
SizeHinter *child = new SizeHinter(parent);
|
||||
QGraphicsWidget parent;
|
||||
SizeHinter *child = new SizeHinter(&parent);
|
||||
|
||||
QCOMPARE(child->minimumSize(), QSizeF(5, 5));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user