[vlc-commits] lua: remove broken code

Pierre Ynard git at videolan.org
Mon Mar 21 01:50:25 CET 2011


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Mon Mar 21 01:44:38 2011 +0100| [6addf026892913a7b2518485bc35d2f9385722d9] | committer: 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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6addf026892913a7b2518485bc35d2f9385722d9
---

 share/lua/intf/modules/host.lua |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/share/lua/intf/modules/host.lua b/share/lua/intf/modules/host.lua
index 321b71b..59e9cf7 100644
--- a/share/lua/intf/modules/host.lua
+++ b/share/lua/intf/modules/host.lua
@@ -278,6 +278,7 @@ function host()
         return wclients, rclients
     end
 
+    -- FIXME: this is never called, client sockets are leaked
     local function destructor( h )
         print "destructor"
         for _,client in pairs(clients) do
@@ -308,14 +309,5 @@ function host()
                 broadcast = _broadcast,
               }
 
-    -- the metatable
-    local m = { -- data
-                __metatable = "Nothing to see here. Move along.",
-                -- methods
-                __gc = destructor,
-              }
-
-    setmetatable( h, m )
-
     return h
 end



More information about the vlc-commits mailing list