summaryrefslogtreecommitdiff
path: root/src/settings/nm-settings.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-03-29 10:39:43 +0200
committerThomas Haller <thaller@redhat.com>2018-04-13 09:09:46 +0200
commitf41279ca1dc14faae433d4c4492b7e2cc49aefaf (patch)
tree97eb68cc1789c7beccdd8ee33fbcef3a84135dfc /src/settings/nm-settings.c
parent213323a6a7a50ed11608cd536833d74c9e9e399e (diff)
downloadNetworkManager-f41279ca1dc14faae433d4c4492b7e2cc49aefaf.tar.gz
settings: use cleanup attribute to keep connection alive during connection_removed()
Diffstat (limited to 'src/settings/nm-settings.c')
-rw-r--r--src/settings/nm-settings.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c
index bf53b62a07..c0a474c297 100644
--- a/src/settings/nm-settings.c
+++ b/src/settings/nm-settings.c
@@ -868,10 +868,12 @@ connection_removed (NMSettingsConnection *connection, gpointer user_data)
NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE (self);
const char *cpath = nm_connection_get_path (NM_CONNECTION (connection));
NMDevice *device;
+ _nm_unused gs_unref_object NMSettingsConnection *connection_keep_alive = NULL;
if (!g_hash_table_lookup (priv->connections, cpath))
g_return_if_reached ();
- g_object_ref (connection);
+
+ connection_keep_alive = g_object_ref (connection);
/* When the default wired connection is removed (either deleted or saved to
* a new persistent connection by a plugin), write the MAC address of the
@@ -906,8 +908,6 @@ connection_removed (NMSettingsConnection *connection, gpointer user_data)
nm_dbus_object_unexport (NM_DBUS_OBJECT (connection));
check_startup_complete (self);
-
- g_object_unref (connection);
}
#define NM_DBUS_SERVICE_OPENCONNECT "org.freedesktop.NetworkManager.openconnect"