diff --git a/src/client/Client.cxx b/src/client/Client.cxx index dc34dccb1..517b98f08 100644 --- a/src/client/Client.cxx +++ b/src/client/Client.cxx @@ -25,6 +25,12 @@ const Domain client_domain("client"); +Client::~Client() noexcept +{ + if (FullyBufferedSocket::IsDefined()) + FullyBufferedSocket::Close(); +} + Instance & Client::GetInstance() noexcept { diff --git a/src/client/Client.hxx b/src/client/Client.hxx index bd3cfc4a5..66be0ead8 100644 --- a/src/client/Client.hxx +++ b/src/client/Client.hxx @@ -101,10 +101,7 @@ public: unsigned _permission, int num) noexcept; - ~Client() noexcept { - if (FullyBufferedSocket::IsDefined()) - FullyBufferedSocket::Close(); - } + ~Client() noexcept; using FullyBufferedSocket::GetEventLoop;