aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/animations
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2022-03-29 10:44:04 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2022-05-04 13:46:02 +0200
commit0238af0bd48b831d72126f2228d5913eccf67bae (patch)
tree831d9586b6d2ee08cfd476d64b35b05dee34df98 /src/qml/animations
parent400a937f6b60898bc7cde1273518b099e66c9124 (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 Pick-to: 6.3 6.2 5.15 Change-Id: I276eeaa9aed1bdb36449b322a24641fa02c4d5e4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/animations')
-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;
}