aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/common/qv4compileddata.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2025-03-03 19:12:01 +0100
committerUlf Hermann <ulf.hermann@qt.io>2025-03-06 09:57:25 +0100
commit6468df7657f6af4de8727363c7f7d97b680b1867 (patch)
treecdfbcd6298dc40ac996c8a5bfda08f26192cfbe9 /src/qml/common/qv4compileddata.cpp
parent68b0ea107c3956a13bdfbfd429072207faf45a79 (diff)
QtQml: Always load from existing compilation units first
If a compilation unit for the given URL already exists in the type registry, we can safely use it since anything in the type registry is shareable. An exception to this are requests with explicit inline source code. Those cannot be cached at all. Conversely, if we were to re-compile, that's not only wasteful but we may end up with diverging type hierarchies and mismatched types. Revert commit d0e16e3f614d73f6694863d2cfb1fbd661c34e3f since it has become counter-productive now. We really want to have exactly one base compilation unit for each type, and that should be universally accessible. When d0e16e3f614d73f6694863d2cfb1fbd661c34e3f was written we had separate base CUs for each engine, and we didn't want those to accidentally find each other. Realize that composite types have to be indexed by url(), not finalUrl(), since url() includes any file selectors while finalUrl() does not. Fixes: QTBUG-134398 Pick-to: 6.9.0 6.9 6.8 6.8.3 Change-Id: I130cdc27ebd8a2814e194478a27eef5bb7f79eb7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/common/qv4compileddata.cpp')
-rw-r--r--src/qml/common/qv4compileddata.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/common/qv4compileddata.cpp b/src/qml/common/qv4compileddata.cpp
index 80b806ec2d..3959c0c2a5 100644
--- a/src/qml/common/qv4compileddata.cpp
+++ b/src/qml/common/qv4compileddata.cpp
@@ -281,7 +281,7 @@ void CompiledData::CompilationUnit::finalizeCompositeType(const QQmlType &type)
qmlType = type;
} else {
qmlType = QQmlMetaType::findCompositeType(
- finalUrl(), this, (unitData()->flags & CompiledData::Unit::IsSingleton)
+ url(), this, (unitData()->flags & CompiledData::Unit::IsSingleton)
? QQmlMetaType::Singleton
: QQmlMetaType::NonSingleton);
}