about summary refs log tree commit diff
path: root/src/settings/nm-settings.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings/nm-settings.c')
-rw-r--r--src/settings/nm-settings.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c
index 6a920d5c..35790a12 100644
--- a/src/settings/nm-settings.c
+++ b/src/settings/nm-settings.c
@@ -1112,8 +1112,10 @@ claim_connection (NMSettings *self, NMSettingsConnection *connection)
 	openconnect_migrate_hack (NM_CONNECTION (connection));
 
 	g_object_ref (self);
-	g_signal_connect (connection, NM_SETTINGS_CONNECTION_REMOVED,
-	                  G_CALLBACK (connection_removed), self);
+	/* This one unexports the connection, it needs to run late to give the active
+	 * connection a chance to deal with its reference to this settings connection. */
+	g_signal_connect_after (connection, NM_SETTINGS_CONNECTION_REMOVED,
+	                        G_CALLBACK (connection_removed), self);
 	g_signal_connect (connection, NM_SETTINGS_CONNECTION_UPDATED_INTERNAL,
 	                  G_CALLBACK (connection_updated), self);
 	g_signal_connect (connection, "notify::" NM_SETTINGS_CONNECTION_VISIBLE,