From 96763dbb105fde20431a264789ac27abfdab841c Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Tue, 12 Jan 2021 16:37:09 +0100 Subject: Do not revert properties of deleted objects If state contains revert action of properties of deleted objects, we should avoid adding them to apply list Fixes: QTBUG-85106 Pick-to: 5.15 Change-Id: Iff57eb9958a054476096f6d951ab7390277a2b39 Reviewed-by: Ulf Hermann --- src/quick/util/qquickstate.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/quick/util/qquickstate.cpp b/src/quick/util/qquickstate.cpp index 71ab1f4d62..6a72754bde 100644 --- a/src/quick/util/qquickstate.cpp +++ b/src/quick/util/qquickstate.cpp @@ -635,6 +635,11 @@ void QQuickState::apply(QQuickTransition *trans, QQuickState *revert) } } if (!found) { + // If revert list contains bindings assigned to deleted objects, we need to + // prevent reverting properties of those objects. + if (d->revertList.at(ii).binding() && !d->revertList.at(ii).property().object()) { + continue; + } QVariant cur = d->revertList.at(ii).property().read(); QQmlPropertyPrivate::removeBinding(d->revertList.at(ii).property()); -- cgit v1.2.3