[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Best way to manage refs in C + Garbage collection in a single collectgarbage() call.
- From: Michael Ferenduros <mike.ferenduros@...>
- Date: Thu, 24 Jul 2008 18:24:20 +0300
On 23 Jul 2008, at 21:34, Brad_Byrd@playstation.sony.com wrote:
So, two questions arise:
1) Is there a better way to manage refs in C++ than the way I'm
2) Is there a way to do this so that everything gets collected in
call to collectgarbage()?
PS: As to the question of whether there's a better way to do it, I
reckon the only question-mark is that if you're storing Lua refs to
all the objects in a container anyway, why bother with replicating
that on the C++ side at all?
I use a different approach myself, because I want to expose objects to
Lua but to manage their lifetimes on the C++ side...turns out this is
fairly involved, but works well.