Destructors vs. Finalizers

Guillaume Piolat via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 26 06:54:15 PDT 2017


On Wednesday, 26 July 2017 at 12:35:19 UTC, Mike Parker wrote:
> On Wednesday, 26 July 2017 at 12:19:15 UTC, Guillaume Piolat 
> wrote:
>>
>> I don't get the distinction between destructors and 
>> "finalizers" but imho the problem is very much that the GC is 
>> calling ~this.
>
> Destructors are deterministic, finalizers are not. At least, 
> that's how I understand the terms are commonly used.

Note that Andrei once proposed in 2014 that the GC wouldn't call 
destructors/finalizers at all:

http://forum.dlang.org/post/ljrm0d$28vf$1@digitalmars.com
> We're considering deprecating ~this() for classes in the future.

Instead the forum community pushed back and what has been done is 
extending the calls to GC-allocated structs.


More information about the Digitalmars-d mailing list