Heisenbug involving Destructors & GC - Help Needed

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 26 20:49:01 PDT 2015


On 06/27/2015 05:44 AM, Temtaime wrote:
> Disagree. Destroy on a pointer calls dtor of a struct.
> Why it should be an error ?

import std.stdio;
bool destroyed=false;
struct S{
     ~this(){ destroyed=true; }
}

void main(){
     auto s=new S;
     destroy(s);
     writeln(destroyed); // false
}



More information about the Digitalmars-d mailing list