From d451b31ceec0ffc67f43aff0a49c8f3630c3785c Mon Sep 17 00:00:00 2001 From: fourtf Date: Sat, 14 Sep 2019 23:23:09 +0200 Subject: [PATCH] fixed loading cached files twice --- src/common/NetworkPrivate.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/NetworkPrivate.cpp b/src/common/NetworkPrivate.cpp index 42b73ae07..ae81277e7 100644 --- a/src/common/NetworkPrivate.cpp +++ b/src/common/NetworkPrivate.cpp @@ -32,6 +32,10 @@ NetworkData::~NetworkData() QString NetworkData::getHash() { + static std::mutex mu; + + std::lock_guard lock(mu); + if (this->hash_.isEmpty()) { QByteArray bytes; @@ -242,7 +246,6 @@ void load(const std::shared_ptr &data) if (data->cache_) { QtConcurrent::run(loadCached, data); - loadCached(data); } else {