Diff between 37bbe30c92a729a4f819fde349443ce07a23cf93 and d6a0539d1ddf9f115e889d2bdd27f038408eaf31

Changed Files

File Additions Deletions Status
mesh/mesh.c +5 -2 modified

Full Patch

diff --git a/mesh/mesh.c b/mesh/mesh.c
index b660a7e..9b2b207 100644
--- a/mesh/mesh.c
+++ b/mesh/mesh.c
@@ -377,6 +377,11 @@ static void node_init_cb(struct mesh_node *node, struct mesh_agent *agent)
 	l_dbus_send(dbus_get_bus(), reply);
 	join_pending->msg = NULL;
 
+	/* Setup disconnect watch */
+	join_pending->disc_watch = l_dbus_add_disconnect_watch(dbus_get_bus(),
+						join_pending->sender,
+						prov_disc_cb, NULL, NULL);
+
 	return;
 
 fail:
@@ -423,8 +428,6 @@ static struct l_dbus_message *join_network_call(struct l_dbus *dbus,
 	sender = l_dbus_message_get_sender(msg);
 
 	join_pending->sender = l_strdup(sender);
-	join_pending->disc_watch = l_dbus_add_disconnect_watch(dbus, sender,
-						prov_disc_cb, NULL, NULL);
 	join_pending->msg = l_dbus_message_ref(msg);
 	join_pending->app_path = app_path;