From 1a267418ddcf19c900fcc32c3b3a4883416d7090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com> Date: Wed, 20 Jul 2022 16:35:47 -0400 Subject: [PATCH] thread pool: release tasks on stop --- src/thread_pool.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/thread_pool.cpp b/src/thread_pool.cpp index f45ddd73..31b7b3cc 100644 --- a/src/thread_pool.cpp +++ b/src/thread_pool.cpp @@ -106,8 +106,7 @@ ThreadPool::stop() { std::lock_guard<std::mutex> l(lock_); running_ = false; - while (not tasks_.empty()) - tasks_.pop(); + tasks_ = {}; cv_.notify_all(); } -- GitLab