Wednesday, January 14, 2009

OO survival kit

If one has:
class MyImplement : public MyInterface

If the destructor of MyInterface is not virtual, then the destructor of MyImplement is not called in this case:

MyInterface * myInterface = new MyImplement();
delete myInterface;
.

No comments: