diff --git a/src/common/reactor.cc b/src/common/reactor.cc index 54e699ebf..d249b3277 100644 --- a/src/common/reactor.cc +++ b/src/common/reactor.cc @@ -514,6 +514,11 @@ namespace Pistache::Aio { auto& wrk = workers_.at(i); + wrk->shutdown(); + + if (wrk->thread.joinable()) + wrk->thread.join(); + wrk->sync->detachAndRemoveAllHandlers(); } } diff --git a/tests/tcp_client.h b/tests/tcp_client.h index e2a51ffc3..77e1dc0c8 100644 --- a/tests/tcp_client.h +++ b/tests/tcp_client.h @@ -13,6 +13,7 @@ #include #include #include +#include namespace Pistache { @@ -32,6 +33,12 @@ namespace Pistache class TcpClient { public: + ~TcpClient() + { + if (fd_ != -1) + ::close(fd_); + } + bool connect(const Pistache::Address& address) { struct addrinfo hints = {}; diff --git a/version.txt b/version.txt index 8ef806eb2..4a51d1b52 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.4.1.20240804 +0.4.1.20240818