manager->d_func()->authenticationManager->clearCache();
if (manager->d_func()->httpThread) {
- // The thread will deleteLater() itself from its finished() signal
manager->d_func()->httpThread->quit();
manager->d_func()->httpThread->wait(5000);
+ if (manager->d_func()->httpThread->isFinished())
+ delete manager->d_func()->httpThread;
+ else
+ QObject::connect(manager->d_func()->httpThread, SIGNAL(finished()), manager->d_func()->httpThread, SLOT(deleteLater()));
manager->d_func()->httpThread = 0;
}
}
QNetworkAccessManagerPrivate::~QNetworkAccessManagerPrivate()
{
if (httpThread) {
- // The thread will deleteLater() itself from its finished() signal
httpThread->quit();
httpThread->wait(5000);
+ if (httpThread->isFinished())
+ delete httpThread;
+ else
+ QObject::connect(httpThread, SIGNAL(finished()), httpThread, SLOT(deleteLater()));
httpThread = 0;
}
}
// At some point we could switch to having multiple threads if it makes sense.
managerPrivate->httpThread = new QThread();
managerPrivate->httpThread->setObjectName(QStringLiteral("httpThread"));
- QObject::connect(managerPrivate->httpThread, SIGNAL(finished()), managerPrivate->httpThread, SLOT(deleteLater()));
managerPrivate->httpThread->start();
thread = managerPrivate->httpThread;
replyDownloadData(delegate->synchronousDownloadData);
}
- // End the thread. It will delete itself from the finished() signal
thread->quit();
thread->wait(5000);
+ if (thread->isFinished())
+ delete thread;
+ else
+ QObject::connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
finished();
} else {