In C#, it's possible that class members can actually be destroyed before the containing object.

Example:

class Stuff
{
    Class1 thing1;
    Class2 thing2;

    ~Stuff() {
        thing1.DoSomeFinalization();  //  [1]
    }
}

I forget what the exact behavior was, but basically, [1] is unsafe because it may have already been destructed/freed by the time ~Stuff() is called.

Is this also true for D?

  Bit

Reply via email to