diff options
Diffstat (limited to 'src/qml/qml')
-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 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); } |