aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlimport.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2017-06-26 14:52:22 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2017-08-02 16:33:05 +0000
commit48c09a85ce397979c7e706e3694c879ffe456e09 (patch)
treecc2c437bb35f05cc68ef384ba00b833cfde11033 /src/qml/qml/qqmlimport.cpp
parent4d393779e7a6ec09267f40420f39f8dc28ed7aef (diff)
Remove unused types on engine destruction
The QML engine destructor as well as trimComponentCache() do now clean out unused composite types that the engine registered internally. This helps avoid 'static' leaks, when more and more types would get registered by the engine. Task-number: QTBUG-61536 Change-Id: I5b32af4b88fbf626de8c0bfbaedb2285b09e3679 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlimport.cpp')
-rw-r--r--src/qml/qml/qqmlimport.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index 89c7fd3214..e197efe72b 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -183,7 +183,7 @@ QQmlType fetchOrCreateTypeForUrl(const QString &urlString, const QHashedStringRe
minorVersion,
buf.constData()
};
- ret = QQmlMetaType::qmlTypeFromIndex(QQmlPrivate::qmlregister(QQmlPrivate::CompositeSingletonRegistration, &reg));
+ ret = QQmlMetaType::registerCompositeSingletonType(reg);
} else {
QQmlPrivate::RegisterCompositeType reg = {
url,
@@ -192,7 +192,7 @@ QQmlType fetchOrCreateTypeForUrl(const QString &urlString, const QHashedStringRe
minorVersion,
buf.constData()
};
- ret = QQmlMetaType::qmlTypeFromIndex(QQmlPrivate::qmlregister(QQmlPrivate::CompositeRegistration, &reg));
+ ret = QQmlMetaType::registerCompositeType(reg);
}
// This means that the type couldn't be found by URL, but could not be