diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2024-09-27 18:19:34 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2024-09-30 20:26:35 +0200 |
| commit | 76ce5e4799f07e7cf4b9ffccf7cdfb5bc07de3c4 (patch) | |
| tree | 27d550d2118d9d7d542631eed033035bdba16440 /src/qml/jsruntime/qv4function.cpp | |
| parent | f8e68c4cd00d3ec36c21acc1cd089ae25af1c17d (diff) | |
QmlCompiler: Do not cache composite metatypes in static members
The metatypes from any old engines may have been deleted.
Retrieve the types from the ResolveTypeReferenceMap instead. That is
much cheaper than doing a full type search and the CU should know the
types it's dealing with.
Sometimes, however, the CU does not pre-resolve the types. In
particular, types only used in function signatures do not end up in the
ResolvedTypeReferenceMap. In those cases, still do the full type search.
Amends commit 8bf5aae19b77b618f3f7a55a59e87c8a319475a8.
Pick-to: 6.8.0 6.8
Task-number: QTBUG-129388
Change-Id: I27f25e1c68de3c752d00345c6d94016fb315e16c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4function.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4function.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp index 82646e2822..02c17d5de3 100644 --- a/src/qml/jsruntime/qv4function.cpp +++ b/src/qml/jsruntime/qv4function.cpp @@ -158,9 +158,7 @@ Function::Function(ExecutionEngine *engine, ExecutableCompilationUnit *unit, if (type == 0 || !typeLoader) return QQmlType(); - const auto &base = unit->baseCompilationUnit(); - const QQmlType qmltype = QQmlTypePrivate::compositeQmlType( - base, typeLoader, base->stringAt(type)); + const QQmlType qmltype = QQmlTypePrivate::visibleQmlTypeByName(unit, type, typeLoader); return qmltype.typeId().isValid() ? qmltype : QQmlType(); }; |
