Blog: GC

tsbockman thomas.bockman at gmail.com
Wed Mar 10 19:59:33 UTC 2021


On Saturday, 6 March 2021 at 20:45:00 UTC, Adam D. Ruppe wrote:
> On Saturday, 6 March 2021 at 20:21:41 UTC, Rumbu wrote:
>> It seems that the author failed to update himself or - what's 
>> worse - wants to justify D failure in having deterministic 
>> class destruction by pointing to others.
>
> D *does* have deterministic class destruction. `scope Object o 
> = new Object;`. Also `scope(exit) .destroy(o);`.

Be warned that there is currently a bug where even `scope C c = 
new C;` will not actually call the destructor for extern(C++) 
classes:
     https://issues.dlang.org/show_bug.cgi?id=21693

There doesn't seem to be any fundamental reason for this, though; 
it's just an oversight that will hopefully be fixed soon.


More information about the Digitalmars-d mailing list