[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: luaL_ref on tables with weak values?
- From: Per Bull Holmen <pbholmen@...>
- Date: Fri, 12 Feb 2010 02:29:39 -0800 (PST)
Per Bull Holmen wrote:
> Suppose that I want to keep a reference to a Lua object in C, but I
> don't want to prevent it from being collected. When the Lua object is
> collected, a full userdata will be collected with it, so I can keep
> track of when it gets collected, and can take appropriate action to
> unref the reference. I just don't want to prevent the garbage
> collection from happening. The 2nd edition of PiL doesn't mention how
> luaL_ref will work if the object is held in a weak table.
Sorry, guys, I should have searched the archive better:
http://lua-users.org/lists/lua-l/2002-01/msg00437.html
I believe this means I CAN use luaL_ref on a weak table, and things will work as expected. Sorry for asking something I should have found through searching...!!
Per