[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Integration of C++ objects into Lua
- From: RLake@...
- Date: Wed, 26 Nov 2003 09:24:15 -0500
> Is there any way I can get rid of all the Lua proxies of a C++
> object I've deleted?
The easiest way is to use a double proxy. The first proxy delegates
to the second one; you release the first one to Lua. Then you can
replace the first proxy's proxy with a function that throws an error
or returns nil, or whatever.
However, I'm not sure if you are asking the right question. Perhaps
you would be better off taking advantage of Lua's garbage collector
and not deleting your C++ object until there are no references to
it left. That simply requires a __gc metamethod.