aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlmetatype.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-06-28 13:28:09 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-06-28 13:28:10 +0200
commit63398defdbec12979b61120f690e984af0496c37 (patch)
treeab7a29ea0040d46c47004fed3c211a831bc48e9c /src/qml/qml/qqmlmetatype.cpp
parentcff8d9f1d2d309cd9417bb93386a1443ed1892c3 (diff)
parent692b2da77427259a3589cf8a1311075863f2f5ec (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Diffstat (limited to 'src/qml/qml/qqmlmetatype.cpp')
-rw-r--r--src/qml/qml/qqmlmetatype.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp
index 29b19b433f..0f8a850584 100644
--- a/src/qml/qml/qqmlmetatype.cpp
+++ b/src/qml/qml/qqmlmetatype.cpp
@@ -1641,7 +1641,14 @@ void qmlClearTypeRegistrations() // Declared in qqml.h
#endif
}
-static int registerAutoParentFunction(QQmlPrivate::RegisterAutoParent &autoparent)
+static void unregisterAutoParentFunction(const QQmlPrivate::AutoParentFunction &function)
+{
+ QMutexLocker lock(metaTypeDataLock());
+ QQmlMetaTypeData *data = metaTypeData();
+ data->parentFunctions.removeOne(function);
+}
+
+static int registerAutoParentFunction(const QQmlPrivate::RegisterAutoParent &autoparent)
{
QMutexLocker lock(metaTypeDataLock());
QQmlMetaTypeData *data = metaTypeData();
@@ -1950,6 +1957,26 @@ int QQmlPrivate::qmlregister(RegistrationType type, void *data)
return dtype.index();
}
+void QQmlPrivate::qmlunregister(RegistrationType type, quintptr data)
+{
+ switch (type) {
+ case AutoParentRegistration:
+ unregisterAutoParentFunction(reinterpret_cast<AutoParentFunction>(data));
+ break;
+ case QmlUnitCacheHookRegistration:
+ QQmlMetaType::removeCachedUnitLookupFunction(
+ reinterpret_cast<QmlUnitCacheLookupFunction>(data));
+ break;
+ case TypeRegistration:
+ case InterfaceRegistration:
+ case SingletonRegistration:
+ case CompositeRegistration:
+ case CompositeSingletonRegistration:
+ qmlUnregisterType(data);
+ break;
+ }
+}
+
//From qqml.h
bool qmlProtectModule(const char *uri, int majVersion)
{