Which destructor is called when in C++?
- by BastiBechtold
I am hunting memory leaks in a program.
I narrowed it down to some destructors not being called. However, I can't figure out why:
class CMain : public CList {
public:
CMain();
virtual ~CMain();
...
}
class CList : public CProc {
public:
CList();
virtual ~CList();
...
}
CMain gets deallocated just fine, but ~CList() is never called. All parent classes of CList have virtual destructors, too.
Do you have any hints about why the destructor for CList is never called?