summary refs log tree commit diff
path: root/src/nm-active-connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nm-active-connection.c')
-rw-r--r--src/nm-active-connection.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c
index 15b4b485..6e3a5da6 100644
--- a/src/nm-active-connection.c
+++ b/src/nm-active-connection.c
@@ -101,6 +101,10 @@ nm_active_connection_set_state (NMActiveConnection *self,
 	if (priv->state == new_state)
 		return;
 
+	/* DEACTIVATED is a terminal state */
+	if (priv->state == NM_ACTIVE_CONNECTION_STATE_DEACTIVATED)
+		g_return_if_fail (new_state != NM_ACTIVE_CONNECTION_STATE_DEACTIVATED);
+
 	old_state = priv->state;
 	priv->state = new_state;
 	g_object_notify (G_OBJECT (self), NM_ACTIVE_CONNECTION_STATE);
@@ -110,6 +114,12 @@ nm_active_connection_set_state (NMActiveConnection *self,
 		nm_settings_connection_update_timestamp (NM_SETTINGS_CONNECTION (priv->connection),
 		                                         (guint64) time (NULL), TRUE);
 	}
+
+	if (priv->state == NM_ACTIVE_CONNECTION_STATE_DEACTIVATED) {
+		/* Device is no longer relevant when deactivated */
+		g_clear_object (&priv->device);
+		g_object_notify (G_OBJECT (self), NM_ACTIVE_CONNECTION_DEVICES);
+	}
 }
 
 const char *