diff options
Diffstat (limited to 'src/qml/animations/qanimationgroupjob.cpp')
-rw-r--r-- | src/qml/animations/qanimationgroupjob.cpp | 10 |
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; |