diff options
Diffstat (limited to 'src/qml/qml/qqmlmetatype.cpp')
-rw-r--r-- | src/qml/qml/qqmlmetatype.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index 9dea173127..6b7a8be27b 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -1411,6 +1411,16 @@ void QQmlMetaType::unregisterType(int typeIndex) } } +static bool hasActiveInlineComponents(const QQmlTypePrivate *d) +{ + for (const QQmlType &ic : qAsConst(d->objectIdToICType)) { + const QQmlTypePrivate *icPriv = ic.priv(); + if (icPriv && icPriv->count() > 1) + return true; + } + return false; +} + void QQmlMetaType::freeUnusedTypesAndCaches() { QQmlMetaTypeDataPtr data; @@ -1425,7 +1435,7 @@ void QQmlMetaType::freeUnusedTypesAndCaches() QList<QQmlType>::Iterator it = data->types.begin(); while (it != data->types.end()) { const QQmlTypePrivate *d = (*it).priv(); - if (d && d->count() == 1) { + if (d && d->count() == 1 && !hasActiveInlineComponents(d)) { deletedAtLeastOneType = true; removeQQmlTypePrivate(data->idToType, d); |