~ThreadSignalSocket()
{
+ ServerInstance->SE->DelFd(this);
+ ServerInstance->SE->Close(GetFd());
}
void Notify()
SocketThread::SocketThread()
{
+ signal.sock = NULL;
int fd = eventfd(0, EFD_NONBLOCK);
if (fd < 0)
- throw new CoreException("Could not create pipe " + std::string(strerror(errno)));
+ throw CoreException("Could not create pipe " + std::string(strerror(errno)));
signal.sock = new ThreadSignalSocket(this, fd);
}
#else
~ThreadSignalSocket()
{
close(send_fd);
+ ServerInstance->SE->DelFd(this);
+ ServerInstance->SE->Close(GetFd());
}
void Notify()
SocketThread::SocketThread()
{
+ signal.sock = NULL;
int fds[2];
if (pipe(fds))
- throw new CoreException("Could not create pipe " + std::string(strerror(errno)));
+ throw CoreException("Could not create pipe " + std::string(strerror(errno)));
signal.sock = new ThreadSignalSocket(this, fds[0], fds[1]);
}
#endif
SocketThread::~SocketThread()
{
+ if (signal.sock)
+ {
+ signal.sock->cull();
+ delete signal.sock;
+ }
}