Can I increment the ref count for a userdata stored in another userdata?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Can I increment the ref count for a userdata stored in another userdata?

Sam Roberts-2

I have a userdata, it can have a reference to another userdata inside
it. I don't want the referenced userdata garbage collected until there
isn't a reference to it from C code anymore.

Is luaL_ref() what I want?

Thanks,
Sam

Reply | Threaded
Open this post in threaded view
|

Re: Can I increment the ref count for a userdata stored in another userdata?

Adam D. Moss
Sam Roberts wrote:
> I have a userdata, it can have a reference to another userdata inside
> it. I don't want the referenced userdata garbage collected until there
> isn't a reference to it from C code anymore.
>
> Is luaL_ref() what I want?

Sounds like it.

--adam