[Interest] Destructor of QThread is not virtual in 4.7.1

Scott Aron Bloom scott.bloom at onshorecs.com
Thu Aug 1 19:54:31 CEST 2013


QObjects destructor IS virtual, so all derived classes' destructors are also virtual..

For clarity I agree with you.. however in reality it doesn't matter.

Scott
-----Original Message-----
From: interest-bounces+scott.bloom=onshorecs.com at qt-project.org [mailto:interest-bounces+scott.bloom=onshorecs.com at qt-project.org] On Behalf Of Bill Crocker
Sent: Thursday, August 01, 2013 10:50 AM
To: interest at qt-project.org
Subject: [Interest] Destructor of QThread is not virtual in 4.7.1

Gang:

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?

Bill


_______________________________________________
Interest mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list