Fix thread safety regression of QNetworkConfigurationManager
authorShane Kearns <shane.kearns@accenture.com>
Fri, 13 May 2011 15:19:18 +0000 (16:19 +0100)
committerQt Continuous Integration System <qt-info@nokia.com>
Thu, 26 May 2011 12:16:18 +0000 (14:16 +0200)
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
(cherry picked from commit e9e95f75e7c1e8325c2acce0087ff8677d773779)

Change-Id: I8b89fa89766679beb2d469f9bbd1f5e2233f061b
Reviewed-on: http://codereview.qt.nokia.com/138
Reviewed-by: Markus Goetz
src/network/bearer/qnetworkconfigmanager_p.cpp
src/network/bearer/qnetworkconfigmanager_p.h

index 338cf59..54cd898 100644 (file)
@@ -488,7 +488,7 @@ void QNetworkConfigurationManagerPrivate::enablePolling()
     ++forcedPolling;
 
     if (forcedPolling == 1)
-        startPolling();
+        QMetaObject::invokeMethod(this, "startPolling");
 }
 
 void QNetworkConfigurationManagerPrivate::disablePolling()
index 02e00b9..04cce20 100644 (file)
@@ -107,7 +107,7 @@ private Q_SLOTS:
     void pollEngines();
 
 private:
-    void startPolling();
+    Q_INVOKABLE void startPolling();
     QTimer *pollTimer;
 
 private: