aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Arve Sæther <jan-arve.saether@qt.io>2020-09-22 17:39:58 +0200
committerJan Arve Sæther <jan-arve.saether@qt.io>2021-02-02 14:42:04 +0100
commitbb2c3bfa4f4d001ec39d54d038943f9533f4c952 (patch)
treea70989b8d6d376ee99fffaf3a07f0c0c12fbb238
parent1cb0e3dc5508359f5fc79eda79964db4ef8882c9 (diff)
QQmlProperty: Guard QQmlContextData with QQmlGuardedContextData
Some animation classes store the property to animate in a QQmlProperty. In some cases (e.g. ListView delegates), the item that is animated (and therefore the context) might get destroyed while the animation is running. And since the QQmlContextData in QQmlProperty was not guarded, it could sometimes cause a access violation crash as the task demonstrates. Fixes: QTBUG-86567 Change-Id: I2c8c4f0dca8029887702adeae542eadc47451f60 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r--src/qml/qml/qqmlproperty_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlproperty_p.h b/src/qml/qml/qqmlproperty_p.h
index 8abd83d7b4..b76a216cf3 100644
--- a/src/qml/qml/qqmlproperty_p.h
+++ b/src/qml/qml/qqmlproperty_p.h
@@ -71,7 +71,7 @@ class QQmlMetaObject;
class Q_QML_PRIVATE_EXPORT QQmlPropertyPrivate : public QQmlRefCount
{
public:
- QQmlContextData *context;
+ QQmlGuardedContextData context;
QPointer<QQmlEngine> engine;
QPointer<QObject> object;