about summary refs log tree commit diff
path: root/src/nm-active-connection.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2013-02-20 23:06:55 +0100
committerMichael Biebl <biebl@debian.org>2013-02-20 23:06:55 +0100
commit6bb18bdca6b7bf811bdd00dbea1b09f3a367d2dc (patch)
tree8fec068abdd1bc1ade3839f599e1c18d6c524a6a /src/nm-active-connection.c
parentfdcb282bbb150da0049cf2dd5b54e56eb3d0b55f (diff)
parent8d275584fc94f398f0a7c990dcd057533d9a5856 (diff)
Merge tag 'upstream/0.9.8.0' into experimental
Upstream version 0.9.8.0
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 *