From 5fee28537b5f2ed6f1ca1558545597b66ec22270 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 5 Nov 2021 15:00:24 +0100 Subject: Clean up PropertyCache life cycle We generally want to use QQmlRefPointer for it, rather than manually calling addref() and release() all over the place. Also, we can completely inline its ctor and drop an unused member. Also, do not keep property caches of dynamic meta objects in type registry. The dynamic metaobjects will change, and the outdated property caches will eventually be retrieved. Change-Id: I8042c85b32f3031b554f97a35c1545a3412d2acb Reviewed-by: Andrei Golubev --- src/qml/qml/qqmljavascriptexpression.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/qml/qqmljavascriptexpression.cpp') diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp index 854a22d8ba..732ab0e9f3 100644 --- a/src/qml/qml/qqmljavascriptexpression.cpp +++ b/src/qml/qml/qqmljavascriptexpression.cpp @@ -349,7 +349,7 @@ void QQmlPropertyCapture::captureProperty(QObject *o, int c, int n, bool doNotif if (c >= 0) { const QQmlData *ddata = QQmlData::get(o, /*create=*/false); const QMetaObject *metaObjectForBindable = nullptr; - if (auto const propCache = ddata ? ddata->propertyCache : nullptr; propCache) { + if (auto const propCache = (ddata ? ddata->propertyCache.data() : nullptr)) { Q_ASSERT(propCache->property(c)); if (propCache->property(c)->isBindable()) metaObjectForBindable = propCache->metaObject(); -- cgit v1.2.3