lua-users home
lua-l archive

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

On Sat, Jan 31, 2009 at 11:33 AM, Luiz Henrique de Figueiredo <> wrote:
> if there's no other references, Lua will GC module table. so you can
> set your own GC handler and do necessary cleanup.

You cannot set __gc for tables. But you can say use a udata as upvalue for
all functions registered in the module and then clean up when that udata
is collected.

I have also thought about what to do in this situation and I am still learning these tricks. Any examples would be very helpful. Thanks.