Safer thread deletion

This commit is contained in:
craig.p.drummond
2013-03-08 21:57:55 +00:00
parent 167ac05b04
commit 654726f769

View File

@@ -228,10 +228,7 @@ void Utils::msleep(int msecs)
void Utils::stopThread(QThread *thread)
{
thread->quit();
for(int i=0; i<10 && thread->isRunning(); ++i) {
sleep();
}
thread->deleteLater();
thread->connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
}
#ifndef ENABLE_KDE_SUPPORT