g_ptr_array_new_with_free_func is there since glib 2.22,
use the older g_ptr_array_foreach instead.
Reported-by: Peter Maydell <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
return var;
}
-static void aml_free(gpointer data)
+static void aml_free(gpointer data, gpointer user_data)
{
Aml *var = data;
build_free_array(var->buf);
Aml *var;
assert(!alloc_list);
- alloc_list = g_ptr_array_new_with_free_func(aml_free);
+ alloc_list = g_ptr_array_new();
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;
}