From bbbf8363741eba117f33f698586395d0a5517fee Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 2 Mar 2024 10:57:37 +0100 Subject: [PATCH] fix: Race condition when downloading multiple elements from the content store --- plugins/builtin/source/content/views/view_store.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/builtin/source/content/views/view_store.cpp b/plugins/builtin/source/content/views/view_store.cpp index 6b9de4114..08689b6b5 100644 --- a/plugins/builtin/source/content/views/view_store.cpp +++ b/plugins/builtin/source/content/views/view_store.cpp @@ -207,7 +207,11 @@ namespace hex::plugin::builtin { continue; m_download.wait(); - this->handleDownloadFinished(category, entry); + + while (m_download.valid()) { + std::this_thread::sleep_for(10ms); + } + task.update(progress); } } @@ -369,7 +373,6 @@ namespace hex::plugin::builtin { log::error("Download failed! HTTP Code {}", response.getStatusCode()); } - m_download = {}; }