aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/animations
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-02-14 15:49:12 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2019-02-26 04:00:18 +0000
commitea17082234d9921c1fdf34a1f34fa28eeb7faf88 (patch)
treee5a0c21b2fe31f67e24a90bb9baf4037df684d88 /src/qml/animations
parent3992bfea550f2caae9750e3fb8d456335248dc87 (diff)
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 <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/animations')
-rw-r--r--src/qml/animations/qanimationgroupjob.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/qml/animations/qanimationgroupjob.cpp b/src/qml/animations/qanimationgroupjob.cpp
index 344791fd83..66599561fc 100644
--- a/src/qml/animations/qanimationgroupjob.cpp
+++ b/src/qml/animations/qanimationgroupjob.cpp
@@ -120,13 +120,9 @@ void QAnimationGroupJob::removeAnimation(QAbstractAnimationJob *animation)
void QAnimationGroupJob::clear()
{
- QAbstractAnimationJob *child = firstChild();
- QAbstractAnimationJob *nextSibling = nullptr;
- while (child != nullptr) {
- child->m_group = nullptr;
- nextSibling = child->nextSibling();
- delete child;
- child = nextSibling;
+ while (QAbstractAnimationJob *child = firstChild()) {
+ removeAnimation(child);
+ delete child;
}
m_firstChild = nullptr;
m_lastChild = nullptr;