From e9e95f75e7c1e8325c2acce0087ff8677d773779 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Fri, 13 May 2011 16:19:18 +0100 Subject: Fix thread safety regression of QNetworkConfigurationManager Changes in 4.8 led to a timer being created in the wrong thread. I have restored the invokeMethod used to call startPolling() to solve this problem. Reviewed-By: mread --- src/network/bearer/qnetworkconfigmanager_p.cpp | 2 +- src/network/bearer/qnetworkconfigmanager_p.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/bearer/qnetworkconfigmanager_p.cpp b/src/network/bearer/qnetworkconfigmanager_p.cpp index a948d91..42fc49d 100644 --- a/src/network/bearer/qnetworkconfigmanager_p.cpp +++ b/src/network/bearer/qnetworkconfigmanager_p.cpp @@ -488,7 +488,7 @@ void QNetworkConfigurationManagerPrivate::enablePolling() ++forcedPolling; if (forcedPolling == 1) - startPolling(); + QMetaObject::invokeMethod(this, "startPolling"); } void QNetworkConfigurationManagerPrivate::disablePolling() diff --git a/src/network/bearer/qnetworkconfigmanager_p.h b/src/network/bearer/qnetworkconfigmanager_p.h index abc4b9b..45d6a75 100644 --- a/src/network/bearer/qnetworkconfigmanager_p.h +++ b/src/network/bearer/qnetworkconfigmanager_p.h @@ -107,7 +107,7 @@ private Q_SLOTS: void pollEngines(); private: - void startPolling(); + Q_INVOKABLE void startPolling(); QTimer *pollTimer; private: -- cgit v0.12