Skip to content

Commit

Permalink
Update EpollTaskScheduler.cpp
Browse files Browse the repository at this point in the history
fixed file descriptor leak.
  • Loading branch information
PHZ76 authored Jan 27, 2022
1 parent eca25f4 commit 1fe0ac9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/net/EpollTaskScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1fe0ac9

Please sign in to comment.