lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 23 Jul 2008, at 21:34, wrote:

So, two questions arise:
1) Is there a better way to manage refs in C++ than the way I'm doing it? 2) Is there a way to do this so that everything gets collected in the same
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.