According to this, it states that Destructors cannot be inherited or overloaded.
In my case, for all subclasses, the destructors will be identical. Is this pretty much telling me that I must define the same destructor in each sub class. There is no way that I can declare the destructor in the base class and have the handle the destruction? Say I have something like this:
class A
{
~A()
{
SomethingA();
}
}
class B : A
{
}
B b = new B();
When B
is destroyed, its destructor wont be called?
The finalizer you defined in A will be called when an instance of B is destroyed.
If you define a finalizer in both A and B, the most specific finalizer (B) will run first, then the least specific (A).