Close the epoll fd

This commit is contained in:
Florent Le Coz
2016-02-24 09:31:30 +01:00
parent 1f1a27c930
commit b29d94444d
+3
View File
@@ -6,6 +6,7 @@
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <signal.h> #include <signal.h>
#include <unistd.h>
#include <cstring> #include <cstring>
#include <iostream> #include <iostream>
@@ -27,6 +28,8 @@ Poller::Poller()
Poller::~Poller() Poller::~Poller()
{ {
if (this->epfd > 0)
::close(this->epfd);
} }
void Poller::add_socket_handler(SocketHandler* socket_handler) void Poller::add_socket_handler(SocketHandler* socket_handler)