aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-08-24 14:10:41 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2020-08-28 13:49:08 +0200
commit8248b5a485a2b8885442d6511906526548d9d07e (patch)
tree07d17281483f54fcbe28ed5a1add80ae0313e381 /src/qml/qml
parent43a532deffce7ee8c273dbff19c1b0ca941e636d (diff)
Always group the metaType and listType together
They are always created and destroyed together, so grouping them makes the required memory management of them easier. Change-Id: Ia1980f31f9bdff6a1accd229bc8380ae153edf67 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml')
-rw-r--r--src/qml/qml/qqmlengine.cpp8
-rw-r--r--src/qml/qml/qqmlpropertycachecreator_p.h4
-rw-r--r--src/qml/qml/qqmltypewrapper.cpp2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index d7cca8e3fc..7191da694d 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -651,7 +651,7 @@ QQmlEnginePrivate::~QQmlEnginePrivate()
for (auto iter = m_compositeTypes.cbegin(), end = m_compositeTypes.cend(); iter != end; ++iter) {
iter.value()->isRegisteredWithEngine = false;
- QQmlMetaType::unregisterInternalCompositeType({iter.value()->metaTypeId, iter.value()->listMetaTypeId});
+ QQmlMetaType::unregisterInternalCompositeType(iter.value()->typeIds);
}
#if QT_CONFIG(qml_debug)
delete profiler;
@@ -2248,7 +2248,7 @@ int QQmlEnginePrivate::listType(int t) const
static QQmlPropertyCache *propertyCacheForPotentialInlineComponentType(int t, const QHash<int, QV4::ExecutableCompilationUnit *>::const_iterator &iter) {
- if (t != (*iter)->metaTypeId.id()) {
+ if (t != (*iter)->typeIds.id.id()) {
// this is an inline component, and what we have in the iterator is currently the parent compilation unit
for (auto &&icDatum: (*iter)->inlineComponentData)
if (icDatum.typeIds.id.id() == t)
@@ -2351,7 +2351,7 @@ void QQmlEnginePrivate::registerInternalCompositeType(QV4::ExecutableCompilation
Locker locker(this);
// The QQmlCompiledData is not referenced here, but it is removed from this
// hash in the QQmlCompiledData destructor
- m_compositeTypes.insert(compilationUnit->metaTypeId.id(), compilationUnit);
+ m_compositeTypes.insert(compilationUnit->typeIds.id.id(), compilationUnit);
for (auto &&data: compilationUnit->inlineComponentData)
m_compositeTypes.insert(data.typeIds.id.id(), compilationUnit);
}
@@ -2361,7 +2361,7 @@ void QQmlEnginePrivate::unregisterInternalCompositeType(QV4::ExecutableCompilati
compilationUnit->isRegisteredWithEngine = false;
Locker locker(this);
- m_compositeTypes.remove(compilationUnit->metaTypeId.id());
+ m_compositeTypes.remove(compilationUnit->typeIds.id.id());
for (auto&& icDatum: compilationUnit->inlineComponentData)
m_compositeTypes.remove(icDatum.typeIds.id.id());
}
diff --git a/src/qml/qml/qqmlpropertycachecreator_p.h b/src/qml/qml/qqmlpropertycachecreator_p.h
index 5c9e806a4e..626b274c2f 100644
--- a/src/qml/qml/qqmlpropertycachecreator_p.h
+++ b/src/qml/qml/qqmlpropertycachecreator_p.h
@@ -649,7 +649,7 @@ inline int QQmlPropertyCacheCreator<ObjectContainer>::metaTypeForParameter(const
auto compilationUnit = tdata->compilationUnit();
- return compilationUnit->metaTypeId.id();
+ return compilationUnit->typeIds.id.id();
}
template <typename ObjectContainer>
@@ -834,7 +834,7 @@ inline QQmlError QQmlPropertyCacheAliasCreator<ObjectContainer>::propertyDataFor
if (referencedType.isValid())
*type = referencedType.typeId().id();
else
- *type = typeRef->compilationUnit()->metaTypeId.id();
+ *type = typeRef->compilationUnit()->typeIds.id.id();
*version = typeRef->version();
diff --git a/src/qml/qml/qqmltypewrapper.cpp b/src/qml/qml/qqmltypewrapper.cpp
index 6258403f33..495822251f 100644
--- a/src/qml/qml/qqmltypewrapper.cpp
+++ b/src/qml/qml/qqmltypewrapper.cpp
@@ -397,7 +397,7 @@ ReturnedValue QQmlTypeWrapper::virtualInstanceOf(const Object *typeObject, const
QQmlRefPointer<QQmlTypeData> td = qenginepriv->typeLoader.getType(typeWrapper->d()->type().sourceUrl());
ExecutableCompilationUnit *cu = td->compilationUnit();
- myQmlType = qenginepriv->metaObjectForType(cu->metaTypeId.id());
+ myQmlType = qenginepriv->metaObjectForType(cu->typeIds.id.id());
} else {
myQmlType = qenginepriv->metaObjectForType(myTypeId.id());
}