diff --git a/src/thread_pool.cpp b/src/thread_pool.cpp
index f45ddd7391a2c1d1789b34cc259f4c48d8a5549a..31b7b3cc2803e72b814aa9b6f90885abbe341daa 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();
 }