aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2019-11-29 10:51:29 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2019-12-11 15:31:50 +0100
commitd18f6c27af18c2cf4090b456349196e9f563e9b3 (patch)
tree87f6f522e4a51e6b711ac134ecd2c8e7ff67958b
parent6dff64714e3683c1af6164f99ffe23b3a0001be1 (diff)
QQuickBehavior: Check that animation is not semi-deleted
QQuickPopup::~QQuickPopup hides its overlay in its destructor. If a Behavior is installed on its opacity property, it will get triggered by this. If the animation associated with the Behavior is a property of the Popup, which is bound to a QML element, it will however be already partially destructed, as QQmlElement<QQuickPopup>::~QQmlElement and in turn QQmlPrivate::qdeclarativeelement_destructor will have deleted its associated memory, before QQuickPopup::~QQuickPopup has been called. As this does not set any pointers to null, it would seem as if the Animation were still valid. To remedy this, we now check if the animation is in fact marked for deletetion, and, if so, bypass the interception. Fixes: QTBUG-80070 Change-Id: I0e33262c6b3963c46e300ae76c05063c00ff258b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 991035ea1f00671d79c340a8a5c038e6aae1ece7) Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--src/quick/util/qquickbehavior.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/util/qquickbehavior.cpp b/src/quick/util/qquickbehavior.cpp
index d024c0099b..d9b13067ad 100644
--- a/src/quick/util/qquickbehavior.cpp
+++ b/src/quick/util/qquickbehavior.cpp
@@ -177,7 +177,7 @@ void QQuickBehavior::write(const QVariant &value)
bool bypass = !d->enabled || !d->finalized || QQmlEnginePrivate::designerMode();
if (!bypass)
qmlExecuteDeferred(this);
- if (!d->animation || bypass) {
+ if (QQmlData::wasDeleted(d->animation) || bypass) {
if (d->animationInstance)
d->animationInstance->stop();
QQmlPropertyPrivate::write(d->property, value, QQmlPropertyData::BypassInterceptor | QQmlPropertyData::DontRemoveBinding);