If you have virtual functions, this is an indicator that the class should be a subclass.
If you do not declare the destructor as virtual, a person with a pointer to the base class can call the destructor, which will not call the subclass's destructor, because it is not a virtual destructor. Such a condition will leave the memory / elements controlled by the subclass in an undefined state, since they will not be properly cleared.
The lesson to be learned is to always do a virtual destructor, even if you already provide an implementation.
source share