|
Could you give us a bit more information? I believe about everyone who answered you answered a different question :-) I can think of two different scenarios: 1) you have a Lua userdata object implemented in C++ that needs a Lua table to represent methods written in Lua. In that case Rici's suggestion would work: store the data in the object's environment. Alternatively (e.g. for Lua 5.0) you could use a separate weak table with your userdata object as the weak key, and the table as the (strong) value. The weak table could be stored in the registry or the module's environment, your choice. 2) you have a C++ object that's not stored as a Lua userdata object. In that case the destructor of your C++ object can remove the reference. Gé On Apr 17, 2007, at 5:28 PM, Brian Weed wrote:
-- Gé Weijers |