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.8 6.5 5.15 Change-Id: Ie9814655c1a52b6dc0d15076eca591fe710d51ae Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> (cherry picked from commit 76e76afb83b87664aeeaf61b400e4259ce80f49a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
8d99d38785
commit
7bf07cc12c
@ -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