From 7700d5369fba86953cfe047484ab895d9a479271 Mon Sep 17 00:00:00 2001 From: mike Date: Fri, 9 May 2025 16:44:33 +0000 Subject: [PATCH] fix potential memory leak on threadpool shutdown --- src/threadpool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/threadpool.cpp b/src/threadpool.cpp index 8f6a084..66e63d3 100644 --- a/src/threadpool.cpp +++ b/src/threadpool.cpp @@ -91,7 +91,7 @@ static void RunTaskQueueItem(const pi::threadpool::TaskQueueItem *entry) { static void WorkerThread(std::future> worker_state_future, const pi::threadpool::ThreadPoolInternalState *internal_state) { pi::threadpool::WorkerState &worker_state = worker_state_future.get(); - while (internal_state->running.load(std::memory_order_seq_cst)) { + while (true) { const pi::threadpool::TaskQueueItem *entry{}; { tparkBeginPark(worker_state.park_handle); entry = worker_state.task_queue.dequeue(true);