Destructor called while object is still alive

Kagamin spam at here.lot
Fri Oct 23 16:27:53 UTC 2020


On Friday, 23 October 2020 at 06:57:05 UTC, Ola Fosheim Grøstad 
wrote:
> It is in use until the end of main. Think locking. Seems like 
> the pointer is optimized away and then the GC collects. Makes 
> RAII useless with GC.
>
> Basically a consequence of the optimizer assuming that there is 
> no GC. A rather serious correctness issue.

Your C++ glasses are too thick, the snippet uses reference type, 
there's no RAII there.


More information about the Digitalmars-d mailing list