
Deleting an object through a pointer to a base class is undefined behaviour unless the destructor in the base class is virtual.
Deleting an object through a pointer to a base class is undefined behaviour unless the destructor in the base class is virtual.