Summary: Destructors of struct members get called at the wrong
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD

--- Comment #0 from Malte Skarupke <> 2012-10-31 10:55:37 
PDT ---
The destructor of the member of a struct doesn't get called when I expect it to
be called. I'd expect it to be called at the end of the destructor of the
containing struct. I'm not sure when it gets called instead, but it is too
late. Here is a case that segfaults in DMD 2.060:

void main()
    bool destructorCalled = false;
    struct DestructorCounter
            destructorCalled = true; // segmentation fault
    struct S
        DestructorCounter a;
    S s;

If this is supposed to be invalid I can provide examples that are most
definitely not supposed to be invalid, but are a bit more lengthy.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to