PDA

View Full Version : Let QThread delete itself with deleteLater();



Lodorot
23rd February 2010, 18:39
Hi,

is it okay to let a QThread delete itself when it is finished by calling deleteLater()?



MyThread::MyThread()
: QThread() {
QObject::connect(this,
SIGNAL(finished()),
this,
SLOT(deleteLater()));
}


It seems to work but could there be any side effects?

Thanks

Lodorot

^NyAw^
24th February 2010, 16:48
Hi,

I think that ther can't be side effects due delete will be executed in the event loop.