[gnome-bluetooth/wip/hadess/small-fixes: 6/8] lib: Use g_auto in device_added callback




commit c99ddcac12a9ed3d525bcefda88f975930bd37f7
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Nov 24 17:09:30 2021 +0100

    lib: Use g_auto in device_added callback

 lib/bluetooth-client.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index 262cb4d4..398ec16c 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -390,9 +390,9 @@ device_added (GDBusObjectManager   *manager,
              Device1              *device,
              BluetoothClient      *client)
 {
-       GDBusProxy *adapter;
+       g_autoptr (GDBusProxy) adapter = NULL;
        const char *adapter_path, *address, *alias, *name, *icon;
-       char **uuids;
+       g_auto(GStrv) uuids = NULL;
        gboolean paired, trusted, connected;
        int legacypairing;
        BluetoothType type = BLUETOOTH_TYPE_ANY;
@@ -450,8 +450,6 @@ device_added (GDBusObjectManager   *manager,
                                   BLUETOOTH_COLUMN_PROXY, device,
                                   -1);
        }
-       g_strfreev (uuids);
-       g_object_unref (adapter);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]