[gnome-bluetooth/wip/hadess/lib-changes] lib: Use g_auto in device_added callback



commit 9dce606411b1afe82b9d2c404f25626abf73e555
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 d0dba02a..e277150c 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -389,9 +389,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;
@@ -449,8 +449,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]