summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPasi Petäjäjärvi <pasi.petajajarvi@qt.io>2022-05-12 15:45:04 +0300
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-05-19 16:38:29 +0000
commit5bcfd28a57878bd7e193b38886950974acf706c1 (patch)
tree1bcae9bb70c1f10974c1cd3eb868fc388c046ff6 /src
parent4ad74c76153afeded9fe1a5f32f2ee7936982853 (diff)
Fix crash when unplugging/plugging ethernet cable5.15
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. Fixes: QTBUG-103327 Change-Id: If14a4f28217ba5883dbc23ba42a1e91b004b7d58 Reviewed-by: Samuli Piippo <samuli.piippo@qt.io> (cherry picked from commit 26b002e1388d197772b56d471a6dd6ecc4ab2509) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-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 18a3525..0c4954a 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
}