summary refs log tree commit diff
path: root/src/nm-active-connection.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2016-08-26 02:18:32 +0200
committerMichael Biebl <biebl@debian.org>2016-08-26 02:18:32 +0200
commit7514efc2f38c9ace4557d4e69d68e7d380389030 (patch)
tree7fb00fda86cfcc2ca377f191633a7cfdbfea7ca3 /src/nm-active-connection.c
parentd6201f5d8daada3d64a0a3e0038e14eebec683ce (diff)
Imported Upstream version 1.4.0 upstream/1.4.0
Diffstat (limited to 'src/nm-active-connection.c')
-rw-r--r--src/nm-active-connection.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c
index 2b7847b2..1844587c 100644
--- a/src/nm-active-connection.c
+++ b/src/nm-active-connection.c
@@ -546,7 +546,7 @@ nm_active_connection_set_device (NMActiveConnection *self, NMDevice *device)
 
 		g_signal_connect (device, NM_DEVICE_STATE_CHANGED,
 		                  G_CALLBACK (device_state_changed), self);
-		g_signal_connect (device, "notify::master",
+		g_signal_connect (device, "notify::" NM_DEVICE_MASTER,
 		                  G_CALLBACK (device_master_changed), self);
 		g_signal_connect (device, "notify::" NM_DEVICE_METERED,
 		                  G_CALLBACK (device_metered_changed), self);
@@ -719,14 +719,14 @@ nm_active_connection_get_assumed (NMActiveConnection *self)
 
 /****************************************************************/
 
-static void unwatch_parent (NMActiveConnection *self);
+static void unwatch_parent (NMActiveConnection *self, gboolean unref);
 
 static void
 parent_destroyed (gpointer user_data, GObject *parent)
 {
 	NMActiveConnection *self = user_data;
 
-	unwatch_parent (self);
+	unwatch_parent (self, FALSE);
 	g_signal_emit (self, signals[PARENT_ACTIVE], 0, NULL);
 }
 
@@ -741,19 +741,20 @@ parent_state_cb (NMActiveConnection *parent_ac,
 	if (parent_state < NM_ACTIVE_CONNECTION_STATE_ACTIVATED)
 		return;
 
-	unwatch_parent (self);
+	unwatch_parent (self, TRUE);
 	g_signal_emit (self, signals[PARENT_ACTIVE], 0, parent_ac);
 }
 
 static void
-unwatch_parent (NMActiveConnection *self)
+unwatch_parent (NMActiveConnection *self, gboolean unref)
 {
 	NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (self);
 
 	g_signal_handlers_disconnect_by_func (priv->parent,
 	                                      (GCallback) parent_state_cb,
 	                                      self);
-	g_object_weak_unref ((GObject *) priv->parent, parent_destroyed, self);
+	if (unref)
+		g_object_weak_unref ((GObject *) priv->parent, parent_destroyed, self);
 	priv->parent = NULL;
 }
 
@@ -1135,7 +1136,7 @@ dispose (GObject *object)
 	g_clear_object (&priv->master);
 
 	if (priv->parent)
-		unwatch_parent (self);
+		unwatch_parent (self, TRUE);
 
 	g_clear_object (&priv->subject);