QDuplicateTracker: store the current seed in the hasher

It's allowed to change asynchronously by another thread.

Pick-to: 6.1 6.0 5.15
Change-Id: I6cdea00671e8479b9c50fffd167836a08a42cc1d
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This commit is contained in:
Thiago Macieira 2021-04-22 08:08:49 -07:00 committed by Giuseppe D'Angelo
parent d385158d52
commit 3458dd2d47

View File

@ -67,8 +67,9 @@ class QDuplicateTracker {
#ifdef __cpp_lib_memory_resource
template <typename HT>
struct QHasher {
size_t storedSeed = qGlobalQHashSeed();
size_t operator()(const HT &t) const {
return QHashPrivate::calculateHash(t, qGlobalQHashSeed());
return QHashPrivate::calculateHash(t, storedSeed);
}
};