[vlc-devel] [vlc-commits] lua: remove broken code

Pierre Ynard linkfanel at yahoo.fr
Tue Mar 22 01:35:02 CET 2011

> > 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.
> As far as I know, the LUA interpreter is not cancellation-safe, so I
> don't see how "the thread [could be] canceled in poll()" from within
> LUA.

Then it gets cancelled whereever it does, but most of time it'll be
when the interface is idle, in poll(). The point is that if the thread
is cancelled, then it's not possible to run any clean-up code in the
lua script, so calling the destructor would be quite convoluted. It's
probably better to just handle the sockets in C.

Pierre Ynard
"Une âme dans un corps, c'est comme un dessin sur une feuille de papier."

More information about the vlc-devel mailing list