[vlc-devel] [vlc-commits] luahttp: fix scope of url handler variables

Pierre Ynard linkfanel at yahoo.fr
Fri May 18 00:32:13 CEST 2012


Attention lua script developers,

> luahttp: fix scope of url handler variables
> 
> The url handlers were declared with local scope, meaning local to the
> lua script file I assume. Since the interface doesn't wait at the end
> of the lua script anymore, they would fall out of scope after interface
> initialization. Then, when the interface was first accessed, garbage
> collection was somehow triggered, unregistering all url callbacks,
> incidentally triggering a deadlock.
> 
> Fixes #6673

Please be careful when using local scope for variables at the top of
your file. If these variables are meant to be global and persist during
all the run time of the script, it would cause them to be wrongly
garbage collected after the script file is loaded and possibly mess up
all the script.

Regards,

-- 
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