[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Replacement for unlocked refs?
- From: Diego Nehab <diego@...>
- Date: Wed, 30 Jan 2002 19:39:23 -0200 (EDT)
Hi,
> I just discovered that unlocked refs are no longer supported
> in the work3 release. I was using them to allow C++ objects to
> keep track of the table which represented them in Lua. What's
> the workaround to allow this in work3?
You can have, for instance, a locked reference to a table associating
your objects userdata with the corresponding object tables. Then set the
mode of this table to weak keys so that when your userdata is collected,
the whole pair is removed automatically from the table and associated
object table will also be collected.
Regards,
Diego.