lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Thanks for explanation, I tried to find more details about what the issue is with 5.1 that is to be improved in 5.2 but couldn't find anything.

Anyways, I did try using the userdata fenv, and that worked perfectly, although i'm not sure exactly why, which bothers me.

---- Mark Hamburg <> wrote: 
> Weak-keyed tables in Lua 5.1 will mark all of their values. So, the  
> callback functions get marked which marks their upvalues which keeps  
> col alive and conceivably button as well.
> Lua 5.2 is supposed to address this, but a better solution is probably  
> to use the fenv tables for userdata because this avoids the repeated  
> marking and scanning cycles the Lua 5.2 solution needs to make as part  
> of the atomic phase and because it's available and works now. (The Lua  
> 5.2 solution is far better than the situation in 5.1, but one still  
> should probably look for other options where possible.)
> Mark