aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKnud Dollereder <knud.dollereder@qt.io>2022-07-07 12:08:50 +0200
committerThomas Hartmann <thomas.hartmann@qt.io>2022-07-13 12:16:31 +0000
commitbb4f751b452b3f25a7eacdc24fcb362a2c992a2d (patch)
treef72fed3b58fd101257c37e1334fb02c1f47ffb0b
parent87a875edb4f82ce22d6b12f6c1aea34ad189405e (diff)
Fix an occasional crash in the qmlpuppet
QQuickKeyframeGroupPrivate::keyframes and QQuickKeyframeGroupPrivate::sortedKeyframes need to stay in sync in order to function correctly. This patch adds a call to the synchronizing function in clear_keyframes like it was done in append_keyframe. Pick-to: 6.3 Pick-to: 6.4 Change-Id: I74f88c83baa18cec4cbe2f3ffc30ade158035f44 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
-rw-r--r--src/timeline/qquickkeyframe.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/timeline/qquickkeyframe.cpp b/src/timeline/qquickkeyframe.cpp
index ccf831c..4890865 100644
--- a/src/timeline/qquickkeyframe.cpp
+++ b/src/timeline/qquickkeyframe.cpp
@@ -145,10 +145,8 @@ QQuickKeyframe* QQuickKeyframeGroupPrivate::keyframe_at(QQmlListProperty<QQuickK
void QQuickKeyframeGroupPrivate::clear_keyframes(QQmlListProperty<QQuickKeyframe> *list)
{
auto q = static_cast<QQuickKeyframeGroup *>(list->object);
- while (q->d_func()->keyframes.count()) {
- QQuickKeyframe *firstKeyframe = q->d_func()->keyframes.at(0);
- q->d_func()->keyframes.removeAll(firstKeyframe);
- }
+ q->d_func()->keyframes.clear();
+ q->d_func()->setupKeyframes();
}
class QQuickKeyframePrivate : public QObjectPrivate