Software /
code /
prosody
Diff
net/dns.lua @ 1949:e3d777d76b1a
net.dns: Remove sockets from socketset when closing them, fixes a leak
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 13 Oct 2009 11:12:49 +0100 |
parent | 1827:fc21e8832848 |
child | 1950:a1d186c8c65a |
line wrap: on
line diff
--- a/net/dns.lua Tue Oct 13 14:54:07 2009 +0500 +++ b/net/dns.lua Tue Oct 13 11:12:49 2009 +0100 @@ -558,8 +558,11 @@ 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