aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2021-01-12 16:37:09 +0100
committerAlexey Edelev <alexey.edelev@qt.io>2021-01-14 14:52:47 +0100
commit96763dbb105fde20431a264789ac27abfdab841c (patch)
treefdad05f0e4529138cd25ab1cb6fef8745546e5eb /src/quick
parent127c79fb7fda16b9a48ce8c425d1700d1aa7502d (diff)
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 <ulf.hermann@qt.io>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/util/qquickstate.cpp5
1 files changed, 5 insertions, 0 deletions
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());