From 38eb2604788b0a2d0c772254cfbba8b484c6270e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Mon, 1 Dec 2014 23:14:57 +0100 Subject: [PATCH] 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 --- client_machine.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client_machine.cpp b/client_machine.cpp index 77e4e845a7..e60c1ddfcf 100644 --- a/client_machine.cpp +++ b/client_machine.cpp @@ -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);