aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmltypeloader.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-09-18 13:07:22 +0200
committerUlf Hermann <ulf.hermann@qt.io>2016-09-21 11:16:28 +0200
commit02b4770c3d867bf0b562db63015a7137479db10a (patch)
tree57157d0101a295fd394bf9acc91dd216fb361264 /src/qml/qml/qqmltypeloader.cpp
parent858c62583ff776edb8c9e539f0331f5d658de2d1 (diff)
parent345226aa3ecee8642c3bf46e40c981d4a49d958e (diff)
Merge remote-tracking branch 'origin/5.7' into 5.8
Conflicts: src/qml/qml/qqmltypeloader.cpp Change-Id: I07647700fc86764c95a5ef95c568e700a70fe45f
Diffstat (limited to 'src/qml/qml/qqmltypeloader.cpp')
-rw-r--r--src/qml/qml/qqmltypeloader.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index 566f5ef767..20bd5d2620 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -1965,10 +1965,13 @@ 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();
+
+ const bool hasError = !typeData->m_compiledData && !typeData->m_errors.isEmpty();
+ const bool isNotReferenced = typeData->isComplete() && typeData->m_compiledData
+ && typeData->m_compiledData->count() == 1;
// typeData->m_compiledData may be set early on in the proccess of loading a file, so it's important
// to check the general loading status of the typeData before making any other decisions.
- if (typeData->isComplete() && typeData->m_compiledData && typeData->count() == 1
- && typeData->m_compiledData->count() == 1) {
+ if (typeData->count() == 1 && (hasError || isNotReferenced)) {
// There are no live objects of this type
unneededTypes.append(iter);
}