diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-03-04 14:56:36 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-03-14 13:26:23 +0100 |
commit | f73fb997f216797c2a79101fd8aa8cb257ec7eba (patch) | |
tree | 754ac36236a90f303081ed629118d2eddd03982b /src/qml/jsruntime/qv4resolvedtypereference.cpp | |
parent | 3f352c5cccf410cc8e9233c209d1e7f57ff1c9db (diff) |
QQmlPropertyCache: Store checksums in type loader
The type loader is specific to the engine. This way we can
calculate/retrieve the checksum without modifying the property cache,
which makes checksum() threadsafe. The checksums are only needed for
loading and storing compilation units from/to disk. Therefore, there is
no point in keeping them inside the property caches anyway.
Task-number: QTBUG-73271
Change-Id: I7bea65e73769f76352bb5947d7229e256e7f2f25
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit a2184b9ab7469bc5ca36478394243a04cda9006c)
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4resolvedtypereference.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4resolvedtypereference.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4resolvedtypereference.cpp b/src/qml/jsruntime/qv4resolvedtypereference.cpp index d81f512391..e78a1d3244 100644 --- a/src/qml/jsruntime/qv4resolvedtypereference.cpp +++ b/src/qml/jsruntime/qv4resolvedtypereference.cpp @@ -96,11 +96,12 @@ QQmlRefPointer<QQmlPropertyCache> ResolvedTypeReference::createPropertyCache(QQm } } -bool ResolvedTypeReference::addToHash(QCryptographicHash *hash, QQmlEngine *engine) +bool ResolvedTypeReference::addToHash( + QCryptographicHash *hash, QQmlEngine *engine, QHash<quintptr, QByteArray> *checksums) { if (m_type.isValid() && !m_type.isInlineComponentType()) { bool ok = false; - hash->addData(createPropertyCache(engine)->checksum(&ok)); + hash->addData(createPropertyCache(engine)->checksum(checksums, &ok)); return ok; } if (!m_compilationUnit) |