Let's say that I have a base class X with only one virtual function.
I extend it to Y and override that function.
I didn't provide explicit destructor for X and Y.
What happens during the destruction in this statement.
Y y;
X *x= &y;
return;
.
.
.
X*x = new Y;
delete x;
return;
Which will cause memory leak..