Re: GC and dispose
- From: Markus Stoeger <spamhole@xxxxxx>
- Date: Wed, 21 Jun 2006 20:48:41 +0200
Simon Hart wrote:
Agree. We often use the Dispose (IDisposable) for cleaning managed resources as well as unmanaged. We tend to use the Finalizer (Destructor) for unmanaged deallocation.
Could you explain why you prefer the finalizer instead of a manual call to Dispose for freeing unmanaged resources?
As far as I know you can never tell when the GC will finalize an object. So it might keep floating around forever as well. Which means that you could run out of handles for example.
Maybe I've misunderstood something behind GC and the finalizer?.
Max
.
- Follow-Ups:
- Re: GC and dispose
- From: Göran Andersson
- Re: GC and dispose
- References:
- GC and dispose
- From: Petros Amiridis
- Re: GC and dispose
- From: Phil Wilson
- Re: GC and dispose
- From: Petros Amiridis
- Re: GC and dispose
- From: Daniel Billingsley
- Re: GC and dispose
- From: Carl Daniel [VC++ MVP]
- Re: GC and dispose
- From: Simon Hart
- GC and dispose
- Prev by Date: How to execute code when a DLL loads?
- Next by Date: Problem with EventHandlers
- Previous by thread: Re: GC and dispose
- Next by thread: Re: GC and dispose
- Index(es):
Relevant Pages
|
Loading