diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2017-06-26 14:52:22 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2017-08-02 16:33:05 +0000 |
commit | 48c09a85ce397979c7e706e3694c879ffe456e09 (patch) | |
tree | cc2c437bb35f05cc68ef384ba00b833cfde11033 /src/qml/qml/qqmlengine.cpp | |
parent | 4d393779e7a6ec09267f40420f39f8dc28ed7aef (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/qqmlengine.cpp')
-rw-r--r-- | src/qml/qml/qqmlengine.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index 6f5dcc0746..3003d18efc 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -694,6 +694,8 @@ QQmlEnginePrivate::~QQmlEnginePrivate() if (incubationController) incubationController->d = 0; incubationController = 0; + QQmlMetaType::freeUnusedTypesAndCaches(); + for (auto iter = m_compositeTypes.cbegin(), end = m_compositeTypes.cend(); iter != end; ++iter) { iter.value()->isRegisteredWithEngine = false; |