From 0b0fd45b50c04c2a9979c1cf8aed43c23a80cae8 Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Tue, 23 Aug 2022 10:03:41 +0200 Subject: Start using a dedicated QThreadPool again instead of a global one This basically reverts a2b5b5c8f6e09ccfaca8044b34f4d9675c3be14a. The global thread pool is also available to the user and by changing the max thread count to something lower than the default, already running threads get stopped, which can cause segfaults. Fixes: QTBUG-104593 Change-Id: I21fea3137ea72b3336bc67499f9ee2f846e18845 Reviewed-by: Paul Lemire (cherry picked from commit f286d11852d956e589e30cf32686179baa28f66c) Reviewed-by: Qt Cherry-pick Bot --- src/core/jobs/qthreadpooler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/jobs/qthreadpooler.cpp b/src/core/jobs/qthreadpooler.cpp index 36ab5ba40..6dfd9f320 100644 --- a/src/core/jobs/qthreadpooler.cpp +++ b/src/core/jobs/qthreadpooler.cpp @@ -50,7 +50,7 @@ QThreadPooler::QThreadPooler(QObject *parent) , m_futureInterface(nullptr) , m_mutex() , m_taskCount(0) - , m_threadPool(QThreadPool::globalInstance()) + , m_threadPool(new QThreadPool(this)) , m_totalRunJobs(0) { m_threadPool->setMaxThreadCount(QAspectJobManager::idealThreadCount()); -- cgit v1.2.3