From b5b5782088c25c67f090500d71fa1ae655383553 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 10 Mar 2022 12:49:35 +0100 Subject: QML: Add more safety to QQmlPropertyCache usages We can almost always use QQmlPropertyCache::ConstPtr. The property cache creator needs mutable property caches for a while, but it can seal them when done. The designer integration does ugly stuff, but that should be limited to a specific environment. And the QQmlOpenMetaObject is rather wrong (again). This needs to be addresses in a later change. Task-number: QTBUG-73271 Change-Id: I1c31fd5936c745029d25b909c30b8d14a30f25d3 Reviewed-by: Andrei Golubev Reviewed-by: Qt CI Bot Reviewed-by: Fabian Kosmale --- src/qml/qml/qqmltypecompiler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/qml/qml/qqmltypecompiler.cpp') diff --git a/src/qml/qml/qqmltypecompiler.cpp b/src/qml/qml/qqmltypecompiler.cpp index 60b42fee1d..617e478e57 100644 --- a/src/qml/qml/qqmltypecompiler.cpp +++ b/src/qml/qml/qqmltypecompiler.cpp @@ -855,7 +855,7 @@ void QQmlComponentAndAliasResolver::findAndRegisterImplicitComponents( qmlObjects->append(syntheticComponent); const int componentIndex = qmlObjects->count() - 1; // Keep property caches symmetric - QQmlRefPointer componentCache + QQmlPropertyCache::ConstPtr componentCache = QQmlMetaType::propertyCache(&QQmlComponent::staticMetaObject); propertyCaches.append(componentCache); -- cgit v1.2.3