Since we now require GLib 2.22+ (commit f40685c), we don't have to work around lack of g_ptr_array_new_with_free_func() anymore.
This reverts commit 2e5feadbf8133b9b108919a2f576943b448a1a06. Signed-off-by: Markus Armbruster <arm...@redhat.com> --- hw/acpi/aml-build.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 77ce00b..65c9d00 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -301,7 +301,7 @@ static Aml *aml_bundle(uint8_t op, AmlBlockFlags flags) return var; } -static void aml_free(gpointer data, gpointer user_data) +static void aml_free(gpointer data) { Aml *var = data; build_free_array(var->buf); @@ -312,14 +312,13 @@ Aml *init_aml_allocator(void) Aml *var; assert(!alloc_list); - alloc_list = g_ptr_array_new(); + alloc_list = g_ptr_array_new_with_free_func(aml_free); var = aml_alloc(); return var; } void free_aml_allocator(void) { - g_ptr_array_foreach(alloc_list, aml_free, NULL); g_ptr_array_free(alloc_list, true); alloc_list = 0; } -- 1.9.3