aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-09-16 23:21:10 +0200
committerLiang Qi <liang.qi@qt.io>2016-09-16 23:21:16 +0200
commit345226aa3ecee8642c3bf46e40c981d4a49d958e (patch)
treeeb49f01c70d239286cb3f08bbe677c47c640cd12 /src/qml/qml
parent5149aa68eca6ede8836ec4f07a14d22d9da9b161 (diff)
parenta273a0ad9c1df7aed612ee6353753f668d545076 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Diffstat (limited to 'src/qml/qml')
-rw-r--r--src/qml/qml/qqmltypeloader.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index 739a833a30..f2f5cffbf8 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -1950,8 +1950,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);
}