Commit 98dbe4be authored by Jason Crain's avatar Jason Crain Committed by Albert Astals Cid

glib: Fix poppler_action_layer_copy function cast warning

In our call to g_list_foreach, the GFunc callback type takes two
arguments, but we pass the g_object_ref function, which only takes one,
so the compiler warns about an incompatible function cast.

Fix this by using a for loop instead of g_list_foreach.
parent 0e6790f1
......@@ -87,7 +87,8 @@ poppler_action_layer_copy (PopplerActionLayer *action_layer)
PopplerActionLayer *retval = g_slice_dup (PopplerActionLayer, action_layer);
retval->layers = g_list_copy (action_layer->layers);
g_list_foreach (action_layer->layers, (GFunc)g_object_ref, nullptr);
for (GList *l = retval->layers; l != nullptr; l = l->next)
g_object_ref (l->data);
return retval;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment