diff options
author | Michael Brasser <mbrasser@ford.com> | 2016-08-26 12:57:58 -0500 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-08-30 08:28:39 +0000 |
commit | c14c382e6e8527be1129788ccca31309b032f99c (patch) | |
tree | dbdb1cfc07afb71418732bdd52bc5c8e1ec37507 /src | |
parent | fcc2c95421710f98c7b2dec73e2c8b0d9164bc9b (diff) |
Allow for garbage collection of types with errors in trimCache()
Change-Id: I821ea14f60871735bface4e2cf4e61fcb61b2784
Task-number: QTBUG-55567
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/qml/qqmltypeloader.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index 01200fd881..6480420212 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -1961,8 +1961,10 @@ 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->count() == 1 - && typeData->m_compiledData->count() == 1) { + + const bool hasError = !typeData->m_compiledData && !typeData->m_errors.isEmpty(); + const bool isNotReferenced = typeData->m_compiledData && typeData->m_compiledData->count() == 1; + if (typeData->count() == 1 && (hasError || isNotReferenced)) { // There are no live objects of this type unneededTypes.append(iter); } |