[Issue 6581] Yet another dtor/postblit problem?

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 1 13:21:44 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6581



--- Comment #1 from Dmitry Olshansky <dmitry.olsh at gmail.com> 2011-09-01 13:21:38 PDT ---
Simplifyied. My best guess is that postlblits for struct members are not
called.

struct A
{
    static int cnt;
    this(int dummy){ cnt++; }
    this(this){ cnt++; }
    ~this(){ cnt--; }
}
struct B
{
    A a;
    static int cnt;
    this(int dummy){ a = a(dummy); cnt++; }
    this(this){ cnt++; }
    ~this(){ cnt--; }
}

void main()
{
    {
    B b = B(42);
    }
    assert(B.cnt == 0);//passes
    assert(A.cnt == 0);//fails A.cnt == -1
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list