diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2016-06-08 17:32:32 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2016-06-11 12:05:08 +0000 |
commit | 210617de78c78af44efdc251ba7a207c5c26e11c (patch) | |
tree | de0a2101492a4c1d02e7c676a2b122cc03e4381f /src/qml/qml | |
parent | 6202ea699f6c2361c0ffcb7690b6c67643cba038 (diff) |
QML: Only release types if they aren't referenced anymorev5.7.0
Just checking for references on m_compiledData is not enough. The
actual component can also be referenced. Thus it won't be deleted
on release(), but cannot be found in the type cache anymore.
Task-number: QTBUG-53761
(cherry picked from commit 2ac19881f92c94f4e9427bd9ff513210675f259e)
Change-Id: If254d5bca1f41ec948ec1438df0d37bf8d531bdf
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml')
-rw-r--r-- | src/qml/qml/qqmltypeloader.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index 29fdf78797..739a833a30 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -1950,7 +1950,8 @@ 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->m_compiledData->count() == 1) { + if (typeData->m_compiledData && typeData->count() == 1 + && typeData->m_compiledData->count() == 1) { // There are no live objects of this type unneededTypes.append(iter); } |