On the D Blog--Symphony of Destruction: Structs, Classes, and the GC

Mike Parker aldacron at gmail.com
Thu Mar 18 12:21:46 UTC 2021


On Thursday, 18 March 2021 at 08:15:01 UTC, Per Nordlöw wrote:

>
> In the mean time a good rule of thumb is to qualify all class 
> destructors as @nogc. I suggest you add this advice to the 
> article, Mike.
>

I actually don't agree with that. I'll be discussion the solution 
in the next article:

if(!GC.inFinalizer) {
...
}

It's perfectly fine to perform GC operations in destructors when 
they aren't invoked by the GC.


More information about the Digitalmars-d-announce mailing list