GC: memory collected but destructors not called

Shachar Shemesh via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 11 20:59:32 PST 2014


On 10/11/14 16:19, Steven Schveighoffer wrote:
>
> Only classes call dtors from the GC. Structs do not. There are many
> hairy issues with structs calling dtors from GC. Most struct dtors
> expect to be called synchronously, and are not expecting to deal with
> multithreading issues.
>
> Note that structs inside classes WILL call dtors.

How is this any different? If one should not be allowed, how is the 
other okay?

Shachar


More information about the Digitalmars-d mailing list