Diff between 653e21ab71b1413b05f5c1d66429de535339768c and 6b3501a79456609dcdd0bab3bbea522dce214609

Changed Files

File Additions Deletions Status
profiles/network/connection.c +5 -2 modified

Full Patch

diff --git a/profiles/network/connection.c b/profiles/network/connection.c
index 2d6c363..9481072 100644
--- a/profiles/network/connection.c
+++ b/profiles/network/connection.c
@@ -640,8 +640,11 @@ void connection_unregister(struct btd_service *service)
 
 	DBG("%s id %u", device_get_path(device), id);
 
-	g_slist_free_full(peer->connections, connection_free);
-	peer->connections = NULL;
+	peer->connections = g_slist_remove(peer->connections, conn);
+	connection_free(conn);
+
+	if (peer->connections != NULL)
+		return;
 
 	g_dbus_unregister_interface(btd_get_dbus_connection(),
 						device_get_path(device),