From 8672a2cfe0170c2da6a9669176deeb6eaa35e0f5 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Thu, 27 Jun 2024 19:54:45 +0200 Subject: [PATCH] fix: Content store downloads getting stuck sometimes --- 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 58262cace..9ac24791a 100644 --- a/plugins/builtin/source/content/views/view_store.cpp +++ b/plugins/builtin/source/content/views/view_store.cpp @@ -207,10 +207,13 @@ namespace hex::plugin::builtin { m_download.wait(); - while (m_download.wait_for(100ms) != std::future_status::ready) { + while (m_download.valid() && m_download.wait_for(100ms) != std::future_status::ready) { task.update(); } + entry.hasUpdate = false; + entry.downloading = false; + task.increment(); } } @@ -324,7 +327,7 @@ namespace hex::plugin::builtin { return false; } - return true; + return downloading; } bool ViewStore::remove(const paths::impl::DefaultPath *pathType, const std::string &fileName) {