Destructor in base class needed to be virtual in C++
Problem Why does a destructor in base class need to be declared virtual?
Follow up - Is it always required for base class to have virtual destructors?
Solution You want them to be virtual so that all subclass destructors are automatically called when the object is destroyed, even if it is destroyed through a pointer to the base class.
Calling a method with an object pointer always invokes:
[Read More]