summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPasi Petäjäjärvi <pasi.petajajarvi@qt.io>2022-05-12 15:45:04 +0300
committerPasi Petäjäjärvi <pasi.petajajarvi@qt.io>2022-05-19 16:39:41 +0300
commit26b002e1388d197772b56d471a6dd6ecc4ab2509 (patch)
tree79ec40d99fbb2129b002e8ddec7a6c0f2aaf30d7
parentd62af1376cc612f386b7e8924724b8ce6f99673d (diff)
Fix crash when unplugging/plugging ethernet cableHEADdev
We do not remove the ethernet service (network) when cable is disconnected. Instead it's "hold in place" via placeholder but that is not checked and plugging cable back will cause crash. Pick-to: 5.15 6.2 6.3 Fixes: QTBUG-103327 Change-Id: If14a4f28217ba5883dbc23ba42a1e91b004b7d58 Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
-rw-r--r--src/networksettings/connman/qnetworksettingsmanager_p.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/networksettings/connman/qnetworksettingsmanager_p.cpp b/src/networksettings/connman/qnetworksettingsmanager_p.cpp
index eb2c1e7..bc92f97 100644
--- a/src/networksettings/connman/qnetworksettingsmanager_p.cpp
+++ b/src/networksettings/connman/qnetworksettingsmanager_p.cpp
@@ -260,9 +260,11 @@ void QNetworkSettingsManagerPrivate::onServicesChanged(ConnmanMapStructList chan
emit q->servicesChanged();
if (auto service = m_unnamedServices.take(path))
- service->deleteLater();
+ if (!service->placeholderState())
+ service->deleteLater();
if (auto service = m_unknownServices.take(path))
- service->deleteLater();
+ if (!service->placeholderState())
+ service->deleteLater();
m_unnamedServicesForSsidConnection.remove(path); // do not delete here
}