The reason:
class A
{
public:
A(){}
virtual ~A() {}
}
class B: public A
{
public:
B(){}
virtual ~B(){}
}
A * a = new B;
delete a; a = 0;
If the destructor of A is not virtual, delete a will not incur the destructor of B.
This means that some heap memory in B may be lost.