From e9aaed4aea9e2a5d38529706a47f97e33b90ce2c Mon Sep 17 00:00:00 2001 From: qicosmos Date: Tue, 11 Jul 2023 14:49:55 +0800 Subject: [PATCH] free pool when destructing --- include/ylt/coro_io/io_context_pool.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/ylt/coro_io/io_context_pool.hpp b/include/ylt/coro_io/io_context_pool.hpp index 79755bb53..256de89a3 100644 --- a/include/ylt/coro_io/io_context_pool.hpp +++ b/include/ylt/coro_io/io_context_pool.hpp @@ -127,10 +127,10 @@ class io_context_pool { return; } - // ~io_context_pool() { - // if (!has_stop()) - // stop(); - // } + ~io_context_pool() { + if (!has_stop()) + stop(); + } std::size_t pool_size() const noexcept { return io_contexts_.size(); }