don't leak epoll descriptor
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47473 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -26,6 +26,8 @@ public:
|
|||||||
// the caller should delete the returned pointer
|
// the caller should delete the returned pointer
|
||||||
static wxEpollDispatcher *Create();
|
static wxEpollDispatcher *Create();
|
||||||
|
|
||||||
|
virtual ~wxEpollDispatcher();
|
||||||
|
|
||||||
// implement base class pure virtual methods
|
// implement base class pure virtual methods
|
||||||
virtual bool RegisterFD(int fd, wxFDIOHandler* handler, int flags = wxFDIO_ALL);
|
virtual bool RegisterFD(int fd, wxFDIOHandler* handler, int flags = wxFDIO_ALL);
|
||||||
virtual bool ModifyFD(int fd, wxFDIOHandler* handler, int flags = wxFDIO_ALL);
|
virtual bool ModifyFD(int fd, wxFDIOHandler* handler, int flags = wxFDIO_ALL);
|
||||||
|
@@ -92,6 +92,14 @@ wxEpollDispatcher::wxEpollDispatcher(int epollDescriptor)
|
|||||||
m_epollDescriptor = epollDescriptor;
|
m_epollDescriptor = epollDescriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxEpollDispatcher::~wxEpollDispatcher()
|
||||||
|
{
|
||||||
|
if ( close(m_epollDescriptor) != 0 )
|
||||||
|
{
|
||||||
|
wxLogSysError(_("Error closing epoll descriptor"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool wxEpollDispatcher::RegisterFD(int fd, wxFDIOHandler* handler, int flags)
|
bool wxEpollDispatcher::RegisterFD(int fd, wxFDIOHandler* handler, int flags)
|
||||||
{
|
{
|
||||||
epoll_event ev;
|
epoll_event ev;
|
||||||
|
Reference in New Issue
Block a user