From c440f331226b3cc32fac6269d88758a4a0c23fc0 Mon Sep 17 00:00:00 2001 From: flow Date: Thu, 15 Dec 2022 13:51:07 -0300 Subject: fix(ResourceModel): use a single ConcurrentTask for parsing tasks This avoids creating a bunch of threads that fills up the maximum amount allowed by QThreadPool, and causes a deadlock between the helper threads and the main thread (main thread tries to create threads in painting code, but isn't able to, so it keeps waiting for a thread to free up, but all the threads are waiting on the main thread to process some events). Signed-off-by: flow --- launcher/minecraft/mod/ResourceFolderModel.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'launcher/minecraft/mod/ResourceFolderModel.h') diff --git a/launcher/minecraft/mod/ResourceFolderModel.h b/launcher/minecraft/mod/ResourceFolderModel.h index fe283b04..f1bc2dd7 100644 --- a/launcher/minecraft/mod/ResourceFolderModel.h +++ b/launcher/minecraft/mod/ResourceFolderModel.h @@ -10,6 +10,7 @@ #include "Resource.h" #include "tasks/Task.h" +#include "tasks/ConcurrentTask.h" class QSortFilterProxyModel; @@ -197,6 +198,7 @@ class ResourceFolderModel : public QAbstractListModel { // Represents the relationship between a resource's internal ID and it's row position on the model. QMap m_resources_index; + ConcurrentTask m_helper_thread_task; QMap m_active_parse_tasks; std::atomic m_next_resolution_ticket = 0; }; -- cgit