From 572c119fd40608ce666d65bf93234c5689704201 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Fri, 30 Jul 2021 15:45:47 +0200 Subject: [PATCH] device: Do not use GLib 2.62 API to extend GPtrArray We are currently only depending on 2.56. --- src/device.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c index 6f01d9c..40bfa2c 100644 --- a/src/device.c +++ b/src/device.c @@ -1124,6 +1124,7 @@ load_all_prints (FprintDevice *rdev) { g_autoptr(GPtrArray) res = g_ptr_array_new_with_free_func (g_object_unref); GSList *user, *users = NULL; + guint i; users = store.discover_users (); @@ -1132,7 +1133,9 @@ load_all_prints (FprintDevice *rdev) const char *username = user->data; g_autoptr(GPtrArray) prints = load_user_prints (rdev, username); - g_ptr_array_extend_and_steal (res, g_steal_pointer (&prints)); + /* TODO: Use g_ptr_array_extend_and_steal with GLib >= 2.62 */ + for (i = 0; i < prints->len; i++) + g_ptr_array_add (res, g_object_ref (g_ptr_array_index (prints, i))); } g_slist_free_full (users, g_free);