diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-10-13 11:12:49 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-10-13 11:12:49 +0100 |
commit | 396757941327fb937b8f05a3d7822e6ce65efa0c (patch) | |
tree | 43d4f4336e85589e85e67ae2c1a5f985986d3488 | |
parent | 193278754c23997fcbf1c7010ec6ac8da72cce90 (diff) | |
download | prosody-396757941327fb937b8f05a3d7822e6ce65efa0c.tar.gz prosody-396757941327fb937b8f05a3d7822e6ce65efa0c.zip |
net.dns: Remove sockets from socketset when closing them, fixes a leak
-rw-r--r-- | net/dns.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/dns.lua b/net/dns.lua index e793c397..fe327ed2 100644 --- a/net/dns.lua +++ b/net/dns.lua @@ -558,8 +558,11 @@ function resolver:socket_wrapper_set (func) -- - - - - - - socket_wrapper_set function resolver:closeall () -- - - - - - - - - - - - - - - - - - closeall - for i,sock in ipairs (self.socket) do self.socket[i]:close () end - self.socket = {} + for i,sock in ipairs (self.socket) do + self.socket[i] = nil; + self.socketset[sock] = nil; + sock:close(); + end end |