Sync GetAddrInfo thread cancel in destructor

QFutureWatcher::cancel() might be still processed
(it's another thread) while the inherited ~QObject()
deletes the FutureWatcher

BUG: 327287
REVIEW: 121225
This commit is contained in:
Thomas Lübking 2014-12-01 23:14:57 +01:00
parent f3a1d1bd3d
commit 38eb260478

View file

@ -71,9 +71,11 @@ GetAddrInfo::~GetAddrInfo()
{
if (m_watcher && m_watcher->isRunning()) {
m_watcher->cancel();
m_watcher->waitForFinished();
}
if (m_ownAddressWatcher && m_ownAddressWatcher->isRunning()) {
m_ownAddressWatcher->cancel();
m_ownAddressWatcher->waitForFinished();
}
if (m_address) {
freeaddrinfo(m_address);