destructors

Bill Baxter dnewsgroup at billbaxter.com
Tue May 1 00:19:20 PDT 2007


Is this ok in D?


class MyClass
{
    OtherClass a;
    this() {
       a = new OtherClass;
    }
    ~this() {
       delete a;
    }
}

I was just trying to fix the crash on exit in the tinyXPath code on 
dsource, and it does the above a lot.

--bb


More information about the Digitalmars-d-learn mailing list