I hate class destructors with a burning passion

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Jun 9 04:50:26 UTC 2021


On 6/6/21 7:54 AM, Mathias LANG wrote:
> Over the past few months, more than half of the critical bug we've 
> encountered which were not due to our own code are related to 
> destructors. Specifically, destructors being invoked by the GC.

Code in class destructors needs special typechecking and be restricted. 
IIRC, among other things it wasn't supposed to assume references to 
other class objects are valid. This has been discussed several times but 
never implemented.


More information about the Digitalmars-d mailing list