Don't expect class destructors to be called at all by the GC

Mike Franklin slavo5150 at yahoo.com
Thu Dec 21 02:57:00 UTC 2017


"Don't expect class destructors to be called at all by the GC"

I was a bit shocked to read that here: 
https://p0nce.github.io/d-idioms/#The-trouble-with-class-destructors

The document tries to clarify with:
"The garbage collector is not guaranteed to run the destructors 
for all unreferenced objects."

Unfortunately, that doesn't really shed much light on this 
oddity.  So, specifically, under what circumstances are 
destructors not called?

Thanks,
Mike


More information about the Digitalmars-d-learn mailing list