lua-users home
lua-l archive

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


> If you want to allow the heavy userdatas to be garbage
> collected, you could just give your registry a metatable
> with weakmode="v".

Please notice that we changed (back) the way you make a table weak: you
should use «setmode(t, "v")» (or lua_setmode, in C), instead of using
the metatable.

Also notice that it is not "polite" to change the weak mode of the
registry, as that table is shared by several libraries. Instead, you
should create a separate table (which can be stored in a registry field)
and set its mode to weak.

-- Roberto