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-09 12:40:06 +0100 |
commit | a2184b9ab7469bc5ca36478394243a04cda9006c (patch) | |
tree | 7b454b7387b6f390433858af5fcca82ed470c6e4 /src/qml/jsruntime/qv4executablecompilationunit.cpp | |
parent | 579013497bb23b2014e2c940c3d2d1dd10847e07 (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.
Pick-to: 6.3
Task-number: QTBUG-73271
Change-Id: I7bea65e73769f76352bb5947d7229e256e7f2f25
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4executablecompilationunit.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4executablecompilationunit.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4executablecompilationunit.cpp b/src/qml/jsruntime/qv4executablecompilationunit.cpp index 7c02391a1a..6e0d07210c 100644 --- a/src/qml/jsruntime/qv4executablecompilationunit.cpp +++ b/src/qml/jsruntime/qv4executablecompilationunit.cpp @@ -858,7 +858,8 @@ bool ExecutableCompilationUnit::saveToDisk(const QUrl &unitUrl, QString *errorSt This function creates a temporary key vector and sorts it to guarantuee a stable hash. This is used to calculate a check-sum on dependent meta-objects. */ -bool ResolvedTypeReferenceMap::addToHash(QCryptographicHash *hash) const +bool ResolvedTypeReferenceMap::addToHash( + QCryptographicHash *hash, QHash<quintptr, QByteArray> *checksums) const { std::vector<int> keys (count()); int i = 0; @@ -868,7 +869,7 @@ bool ResolvedTypeReferenceMap::addToHash(QCryptographicHash *hash) const } std::sort(keys.begin(), keys.end()); for (int key: keys) { - if (!this->operator[](key)->addToHash(hash)) + if (!this->operator[](key)->addToHash(hash, checksums)) return false; } |