2 ms·
for example: http://stackoverflow.com/questions/461203/when-to-use-virtual-destructors http://stackoverflow.com/questions/461203/when-to-use-virtua... class B
by quizotic 12y ago
for example: http://stackoverflow.com/questions/461203/when-to-use-virtual-destructors http://stackoverflow.com/questions/461203/when-to-use-virtua...
class B : public A { ... }
void foo() {
A* someA = new B(...);
...
delete someA;
}
if A destructor is not virtual, then B's resources leak.