[Issue 2834] Struct Destructors are not called by the GC, but called on explicit delete.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 9 23:22:41 PDT 2010


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



--- Comment #2 from Rob Jacques <sandford at jhu.edu> 2010-07-09 23:22:39 PDT ---
>From Issue 4442:
Example brought up by Sean Kelly in private correspondence:

struct S1{ ~this() { writeln("dtor"); } }
void main() {
    auto a = S1();
    auto b = new S1();
    delete b;
    auto c  = new S1();
    c = null;
    GC.collect();
}

"dtor" is only printed twice.

-- 
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