summaryrefslogtreecommitdiff
path: root/glib/poppler-document.cc
diff options
context:
space:
mode:
Diffstat (limited to 'glib/poppler-document.cc')
-rw-r--r--glib/poppler-document.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/glib/poppler-document.cc b/glib/poppler-document.cc
index e9c27796..e2d4f335 100644
--- a/glib/poppler-document.cc
+++ b/glib/poppler-document.cc
@@ -3127,8 +3127,7 @@ layer_free (Layer *layer)
return;
if (layer->kids) {
- g_list_foreach (layer->kids, (GFunc)layer_free, nullptr);
- g_list_free (layer->kids);
+ g_list_free_full (layer->kids, (GDestroyNotify)layer_free);
}
if (layer->label) {
@@ -3276,11 +3275,8 @@ poppler_document_layers_free (PopplerDocument *document)
if (G_UNLIKELY (!document->layers))
return;
- g_list_foreach (document->layers, (GFunc)layer_free, nullptr);
- g_list_free (document->layers);
-
- g_list_foreach (document->layers_rbgroups, (GFunc)g_list_free, nullptr);
- g_list_free (document->layers_rbgroups);
+ g_list_free_full (document->layers, (GDestroyNotify)layer_free);
+ g_list_free_full (document->layers_rbgroups, (GDestroyNotify)g_list_free);
document->layers = nullptr;
document->layers_rbgroups = nullptr;