QDuplicateTracker: store the current seed in the hasher

It's allowed to change asynchronously by another thread.

Change-Id: I6cdea00671e8479b9c50fffd167836a08a42cc1d
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 3458dd2d4773de379ea4c8309096d6e2cfd8a339)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Thiago Macieira 2021-04-22 08:08:49 -07:00 committed by Qt Cherry-pick Bot
parent fd01a9fb75
commit 9b165a3487

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);
}
};