aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2022-03-29 10:44:04 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-06-04 09:13:44 +0000
commitdc0e2fef9a1d76a22c90243ba82ef78833cd341b (patch)
treeacc7e3f58c8c2024d21dbf356cfac4ac188333b0 /src/qml
parentaa3c97d6303441938d2af46c372232aef717c167 (diff)
Quick Animations: Fix crash
SwipeDelegate causes the running animation job to be deleted when calling swipe.close in swipe.completed. Employ the RETURN_IF_DELETED check in more places to avoid crashes. Fixes: QTBUG-100560 Task-number: QTBUG-103223 Change-Id: I276eeaa9aed1bdb36449b322a24641fa02c4d5e4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 0238af0bd48b831d72126f2228d5913eccf67bae) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/animations/qcontinuinganimationgroupjob.cpp4
-rw-r--r--src/qml/animations/qparallelanimationgroupjob.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/animations/qcontinuinganimationgroupjob.cpp b/src/qml/animations/qcontinuinganimationgroupjob.cpp
index 7d24d8ce55..6d2dc38bfd 100644
--- a/src/qml/animations/qcontinuinganimationgroupjob.cpp
+++ b/src/qml/animations/qcontinuinganimationgroupjob.cpp
@@ -81,9 +81,9 @@ void QContinuingAnimationGroupJob::updateState(QAbstractAnimationJob::State newS
return;
}
for (QAbstractAnimationJob *animation : m_children) {
- resetUncontrolledAnimationFinishTime(animation);
+ RETURN_IF_DELETED(resetUncontrolledAnimationFinishTime(animation));
animation->setDirection(m_direction);
- animation->start();
+ RETURN_IF_DELETED(animation->start());
}
break;
}
diff --git a/src/qml/animations/qparallelanimationgroupjob.cpp b/src/qml/animations/qparallelanimationgroupjob.cpp
index 4da4a06af2..0d67b2451e 100644
--- a/src/qml/animations/qparallelanimationgroupjob.cpp
+++ b/src/qml/animations/qparallelanimationgroupjob.cpp
@@ -144,10 +144,10 @@ void QParallelAnimationGroupJob::updateState(QAbstractAnimationJob::State newSta
animation->stop();
m_previousLoop = m_direction == Forward ? 0 : m_loopCount - 1;
}
- resetUncontrolledAnimationFinishTime(animation);
+ RETURN_IF_DELETED(resetUncontrolledAnimationFinishTime(animation));
animation->setDirection(m_direction);
if (shouldAnimationStart(animation, oldState == Stopped))
- animation->start();
+ RETURN_IF_DELETED(animation->start());
}
break;
}