Destructor nonsense on dlang.org

Alex Rønne Petersen alex at lycus.org
Fri May 25 09:00:12 PDT 2012


On 25-05-2012 17:53, Mehrdad wrote:
> On Friday, 25 May 2012 at 14:38:29 UTC, Alex Rønne Petersen wrote:
>> This is called resurrection:
>> http://msdn.microsoft.com/en-us/magazine/bb985010.aspx (scroll down to
>> Resurrection)
>
>
>
> Ah, yes, you're completely right; I missed this fact. Apparently under
> these conditions, you _can_ resurrect objects, but it's bad practice
> (and unnecessary) in most situations.
>
>
> @Andrei: The reason this is allowed is that finalization is _separate_
> from garbage collection in .NET. So an object can be finalized and yet
> still not GC'd. Or its finalizer might be suppressed, allowing it to get
> GC'd directly. This allows for many possibilities, although you don't
> usually need them.

This is, in fact, how most GCs other than D's work. :)

-- 
Alex Rønne Petersen
alex at lycus.org
http://lycus.org


More information about the Digitalmars-d mailing list