From 7b14c47d6adbc6ab3cdfc9d10bef25029215a85f Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Tue, 17 Feb 2015 17:39:14 +0100 Subject: Prevent reading wifi events from closed connection Stop wifi event thread before closing down a connection to wpa-supplicant to avoid race-condition where we can end up reading events from closed socket and blocking the new connection from attaching to the socket. Change-Id: Ie1efabf35791e0dac3f57fa8038b0e414cbff1f5 Reviewed-by: Laszlo Agocs --- src/wifi/qwifimanager.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/wifi/qwifimanager.cpp') diff --git a/src/wifi/qwifimanager.cpp b/src/wifi/qwifimanager.cpp index 14d839e..7585cf2 100644 --- a/src/wifi/qwifimanager.cpp +++ b/src/wifi/qwifimanager.cpp @@ -123,10 +123,8 @@ void QWifiManagerPrivate::updateWifiState() if (ps.readAll().contains("wpa_supplicant")) supplicantRunning = true; #endif - if (supplicantRunning && m_wifiController->resetSupplicantSocket()) { - m_wifiController->startWifiEventThread(); + if (supplicantRunning && m_wifiController->resetSupplicantSocket()) m_backendState = QWifiManager::Running; - } } QString QWifiManagerPrivate::call(const QString &command) -- cgit v1.2.3