From c5a123ab408b06d82e2cc17e818bd862b8b66876 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 18 Aug 2016 16:46:20 +0200 Subject: net.server_epoll: Prevent anything from happening to destroyed sockets --- net/server_epoll.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'net') diff --git a/net/server_epoll.lua b/net/server_epoll.lua index 89f358a5..713baa0c 100644 --- a/net/server_epoll.lua +++ b/net/server_epoll.lua @@ -351,8 +351,14 @@ function interface:destroy() self:setflags(false, false); self:setwritetimeout(false); self:setreadtimeout(false); + self.onreadable = noop; + self.onwriteable = noop; + self.destroy = noop; + self.close = noop; + self.on = noop; fds[self:getfd()] = nil; - return self.conn:close(); + self.conn:close(); + self.conn = nil; end function interface:ssl() -- cgit v1.2.3