diff options
author | Liang Qi <liang.qi@qt.io> | 2016-10-01 22:27:26 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-10-01 22:27:26 +0200 |
commit | ead7aea128d81118886721585058b45f037f5613 (patch) | |
tree | d04f8bce4221d7aa40b6e4ef64a28c193a12fa07 /src/qml/qml/qqmltypeloader.cpp | |
parent | 7e742bff27491b5ecd8713540940683264c240a2 (diff) | |
parent | 5f4299eb597b89df20189a5c5a6235287e54b636 (diff) |
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
src/qml/jsruntime/qv4qobjectwrapper.cpp
Change-Id: I1a125b2334532ec5de4af39c0d6628890f4d0587
Diffstat (limited to 'src/qml/qml/qqmltypeloader.cpp')
-rw-r--r-- | src/qml/qml/qqmltypeloader.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index d4dc668bdc..7730233a93 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -1967,10 +1967,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); } |