lua-users home
lua-l archive

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


On Dec 18, 2009, at 2:50 PM, Andre de Leiradella wrote:

> Can't you just create a reference to A using luaL_ref in each object that needs a reference to it? When destroying these objects, luaL_unref the reference and A will be garbage collected when there are no references to it.

There's a big risk of uncollectable cycles with that approach since the refs are referenced from the registry until you unref them.

Mark