aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlmetatype.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2023-02-14 12:24:55 +0100
committerUlf Hermann <ulf.hermann@qt.io>2023-02-14 16:05:27 +0100
commit6937f2e50dd60c58350a464eb83ba9d11c7146f9 (patch)
tree7fc9b5e74998e8d026d3f19924ed077e188b6325 /src/qml/qml/qqmlmetatype.cpp
parent93956372d9bce55d3bc67690783697a2f2471694 (diff)
QQmlMetaType: Clear property caches on qmlClearTypeRegistrations
Otherwise we may retain dangling pointers referencing invalid property caches. Some metaobjects are created on the heap. If the memory manager decides to re-use the heap space for new metaobjects, we can retrieve the invalid property caches. Pick-to: 6.5 6.4 6.2 Task-number: QTBUG-110933 Change-Id: Ic00bb852151bcf58ba6ae798a6bf2cea686a9e10 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlmetatype.cpp')
-rw-r--r--src/qml/qml/qqmlmetatype.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp
index 054ad48617..e15ba1e6a9 100644
--- a/src/qml/qml/qqmlmetatype.cpp
+++ b/src/qml/qml/qqmlmetatype.cpp
@@ -317,6 +317,7 @@ void QQmlMetaType::clearTypeRegistrations()
data->urlToNonFileImportType.clear();
data->metaObjectToType.clear();
data->undeletableTypes.clear();
+ data->propertyCaches.clear();
}
int QQmlMetaType::registerAutoParentFunction(const QQmlPrivate::RegisterAutoParent &function)