auto classes and finalizers

Jarrett Billingsley kb3ctd2 at yahoo.com
Wed Apr 5 15:40:30 PDT 2006


"Sean Kelly" <sean at f4.ca> wrote in message 
news:e11ca0$ht2$1 at digitaldaemon.com...
> Since finalizers are called when the GC destroys an object, they are very 
> limited in what they can do.  They can't assume any GC managed object they 
> have a reference to is valid, etc.  By contrast, destructors can make this 
> assumption, because the object is being destroyed deterministically.  I 
> think having both may be too confusing to be worthwhile, but it would 
> allow for things like this:
>
> The argument against finalizers, as Mike mentioned, is that you typically 
> want to reclaim such special resources deterministically, so letting the 
> GC take care of this 'someday' is of questionable utility.

Thank you for that clear, concise, and un-condescending reply :) 





More information about the Digitalmars-d mailing list