[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: question: userdata cross references ?
- From: Mark Hamburg <mark@...>
- Date: Fri, 18 Dec 2009 19:05:50 -0800
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