Order of destruction when garbage collection kicks in

Andrej Mitrovic andrej.mitrovich at gmail.com
Tue Apr 9 13:07:35 PDT 2013


On 4/9/13, Henning Pohl <henning at still-hidden.de> wrote:
> In the destructor of A I expect b either to be null or a valid
> instance of B (which has not been destroyed yet).

Hmm yeah I hoped to see it be null too.

> This is IMO a huge drawback
> towards reference counting with strong/weak references.

I don't think D classes were ever meant to be used with reference
counting. Structs yes, but classes are GC's territory.


More information about the Digitalmars-d mailing list