Re: Informing luabind when my c++ created objects get deleted?

Willi Schinmeyer <[email protected]> Tue, 29 Jan 2013 16:56:34 +0100
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
On 1/29/2013 4:46 PM, Harakiri wrote:
> My objects are only managed from C++, there is no creation/deletion in lua.
Well, that inherently comes with the problems you mentioned I guess. Why 
do they need to be deleted at a fixed time then? Why not let Lua take 
care of it?
> - I can create a proxy object and expose it with luabind the proxy 
> object basically wraps the original object and on each method call 
> checks if(object!=NULL) do.... - the issue is i would have to keep 
> this proxy object forever - and the memory consumption would rise 
That's what I would've suggested as well. Some kind of proxy with a weak 
pointer. Why would that proxy be alive forever though? Surely it could 
be deleted via Lua's garbage collection since it's only used in Lua?

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d