[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: "Javier Guerra" <javier@...>
- Date: Wed, 23 Jul 2008 14:06:06 -0500
On Wed, Jul 23, 2008 at 1:34 PM, <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 doing it?
> 2) Is there a way to do this so that everything gets collected in the same
> call to collectgarbage()?
as a general advice, don't wait for __gc() to destroy your objects.
garbage collection is for memory, there's no written contract about
when it will collect your objects. add close() methods (or similar)
to finish useful lifetime.