From ea17082234d9921c1fdf34a1f34fa28eeb7faf88 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 14 Feb 2019 15:49:12 +0100 Subject: QAnimationGroupJob: Notify about removed children on clear() Derived classes, such as QSequentialAnimationGroupJob, might keep additional pointers to the children. Those need to be cleared, too. Therefore, use the regular removeAnimation() method for clearing. Fixes: QTBUG-73828 Change-Id: I64cc1fe4da59f10b29f27012b10f93b4289b6e5a Reviewed-by: Simon Hausmann --- .../qml/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests/auto') diff --git a/tests/auto/qml/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp b/tests/auto/qml/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp index 974357dc8e..6bd8c2a2e0 100644 --- a/tests/auto/qml/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp +++ b/tests/auto/qml/animation/qanimationgroupjob/tst_qanimationgroupjob.cpp @@ -261,15 +261,18 @@ void tst_QAnimationGroupJob::addChildTwice() { QAbstractAnimationJob *subGroup; QAbstractAnimationJob *subGroup2; - QAnimationGroupJob *parent = new QSequentialAnimationGroupJob(); + auto *parent = new QSequentialAnimationGroupJob(); subGroup = new QAbstractAnimationJob; parent->appendAnimation(subGroup); parent->appendAnimation(subGroup); - QVERIFY(parent->firstChild() && !parent->firstChild()->nextSibling()); + QVERIFY(parent->firstChild()); + QVERIFY(!parent->firstChild()->nextSibling()); + QVERIFY(!parent->firstChild()->previousSibling()); parent->clear(); + QCOMPARE(parent->currentAnimation(), nullptr); QVERIFY(!parent->firstChild()); // adding the same item twice to a group will remove the item from its current position -- cgit v1.2.3