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:
parent
f3a1d1bd3d
commit
38eb260478
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue