Commit 6addf026 authored by Pierre Ynard's avatar Pierre Ynard

lua: remove broken code

Only C userdata can set a garbage collector that way. Client sockets
are leaked when the interface is stopped, because the destructor is
never called. And given how the thread is cancelled in poll(), I can't
see a simple way to call it.
parent ce00244d
...@@ -278,6 +278,7 @@ function host() ...@@ -278,6 +278,7 @@ function host()
return wclients, rclients return wclients, rclients
end end
-- FIXME: this is never called, client sockets are leaked
local function destructor( h ) local function destructor( h )
print "destructor" print "destructor"
for _,client in pairs(clients) do for _,client in pairs(clients) do
...@@ -308,14 +309,5 @@ function host() ...@@ -308,14 +309,5 @@ function host()
broadcast = _broadcast, broadcast = _broadcast,
} }
-- the metatable
local m = { -- data
__metatable = "Nothing to see here. Move along.",
-- methods
__gc = destructor,
}
setmetatable( h, m )
return h return h
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment