diff --git a/src/net/EpollTaskScheduler.cpp b/src/net/EpollTaskScheduler.cpp index e73aadd..b2a0f5f 100644 --- a/src/net/EpollTaskScheduler.cpp +++ b/src/net/EpollTaskScheduler.cpp @@ -21,7 +21,12 @@ EpollTaskScheduler::EpollTaskScheduler(int id) EpollTaskScheduler::~EpollTaskScheduler() { - +#if defined(__linux) || defined(__linux__) + if (epollfd_ >= 0) { + close(epollfd_); + epollfd_ = -1; + } +#endif } void EpollTaskScheduler::UpdateChannel(ChannelPtr channel)