[Interest] Destructor of QThread is not virtual in 4.7.1

Bill Crocker william.crocker at analog.com
Thu Aug 1 19:50:13 CEST 2013


Chasing down some memory leaks in my app (Qt 4.7.1) I found that
the destructor of the QThread class is not virtual.

I know there have been discussions about sub-classing QThread,
but if I do, and it is deleted through a pointer, which it is,
it is important that my destructor be called to free my resources.
That requires that the base class destructor be declared virtual,
which it is not.

Note that QThread already has a virtual member function, run(),
so this would not be it's first.

Is true?


More information about the Interest mailing list