There may be other approaches, I too am eager to hear them. :) -asko Wesley Smith kirjoitti 15.2.2007 kello 8.32:
Hi Collective Wisdom, I'm struggling with a design issue in integrating Lua into a C++ library. The way the library is designed, the destructor of an object can create a cascade of destructor calls some of which could potentially be resources referred to in Lua. The problem I'm trying to solve right now is how to manage freeing userdata in Lua once a C++ object having nothing to do with Lua destroys it. Are there idioms people use for dealing with this kind of thing? thanks, wes