gdbus: Avoid using g_ptr_array_new_full convenience function
authorMarcel Holtmann <marcel@holtmann.org>
Sat, 22 Dec 2012 20:05:59 +0000 (12:05 -0800)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 22 Dec 2012 20:09:43 +0000 (12:09 -0800)
The g_ptr_array_new_full function only got introduced with GLib 2.30
and to avoid requiring a newer GLib use g_ptr_array_set_free_func instead.

gdbus/client.c

index 4709cdd..3b00080 100644 (file)
@@ -1008,7 +1008,8 @@ GDBusClient *g_dbus_client_new(DBusConnection *connection,
 
        get_name_owner(client, client->service_name);
 
-       client->match_rules = g_ptr_array_new_full(4, g_free);
+       client->match_rules = g_ptr_array_sized_new(4);
+       g_ptr_array_set_free_func(client->match_rules, g_free);
 
        g_ptr_array_add(client->match_rules, g_strdup_printf("type='signal',"
                                "sender='%s',path='%s',interface='%s',"