diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2016-06-08 17:32:32 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-06-10 19:16:45 +0000 |
commit | 2ac19881f92c94f4e9427bd9ff513210675f259e (patch) | |
tree | c947c81adecbde744ac9e6e325bf6ea66af45c40 /src/qml | |
parent | 56d9505e9d2b7dd9507523693d81f72efaa247c8 (diff) |
QML: Only release types if they aren't referenced anymore
Just checking for references on m_compiledData is not enough. The
actual component can also be referenced. Thus it won't be deleted
on release(), but cannot be found in the type cache anymore.
Task-number: QTBUG-53761
Change-Id: I8567af8e75a078598e4fed31e4717134e1332278
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/qml/qqmltypeloader.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index c684c8602e..01200fd881 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -1961,7 +1961,8 @@ void QQmlTypeLoader::trimCache() QList<TypeCache::Iterator> unneededTypes; for (TypeCache::Iterator iter = m_typeCache.begin(), end = m_typeCache.end(); iter != end; ++iter) { QQmlTypeData *typeData = iter.value(); - if (typeData->m_compiledData && typeData->m_compiledData->count() == 1) { + if (typeData->m_compiledData && typeData->count() == 1 + && typeData->m_compiledData->count() == 1) { // There are no live objects of this type unneededTypes.append(iter); } |