From b9c79a1de5b163c2082d5a722c54e55f448b942e 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 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/thread_pool.cpp b/src/thread_pool.cpp
index 1ebb1abd..f45ddd73 100644
--- a/src/thread_pool.cpp
+++ b/src/thread_pool.cpp
@@ -106,6 +106,8 @@ ThreadPool::stop()
 {
     std::lock_guard<std::mutex> l(lock_);
     running_ = false;
+    while (not tasks_.empty())
+        tasks_.pop();
     cv_.notify_all();
 }
 
-- 
GitLab