summaryrefslogtreecommitdiff
path: root/gtk/gtkfilechooser.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-07-31 17:57:04 -0400
committerMatthias Clasen <mclasen@redhat.com>2015-07-31 22:23:35 -0400
commit9f24b54786d8371f77f9ba0c4475ed82b2e0e68f (patch)
tree8ac32783559f12897ce4e5bbc350ed8aab77e67e /gtk/gtkfilechooser.c
parent9dd2645c4a591e154c2e1fe9e6bd5677c56e928a (diff)
downloadgtk+-9f24b54786d8371f77f9ba0c4475ed82b2e0e68f.tar.gz
Code cleanup
Use g_slist_free_full more consistently. This commit just converts the obvious cases where g_slist_forall is directly followed by g_slist_free.
Diffstat (limited to 'gtk/gtkfilechooser.c')
-rw-r--r--gtk/gtkfilechooser.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/gtk/gtkfilechooser.c b/gtk/gtkfilechooser.c
index 969eae257a..b8513cebb4 100644
--- a/gtk/gtkfilechooser.c
+++ b/gtk/gtkfilechooser.c
@@ -873,8 +873,7 @@ gtk_file_chooser_get_filenames (GtkFileChooser *chooser)
files = gtk_file_chooser_get_files (chooser);
result = files_to_strings (files, g_file_get_path);
- g_slist_foreach (files, (GFunc) g_object_unref, NULL);
- g_slist_free (files);
+ g_slist_free_full (files, g_object_unref);
return result;
}
@@ -1218,8 +1217,7 @@ gtk_file_chooser_get_uris (GtkFileChooser *chooser)
else
result = files_to_strings (files, g_file_get_uri);
- g_slist_foreach (files, (GFunc) g_object_unref, NULL);
- g_slist_free (files);
+ g_slist_free_full (files, g_object_unref);
return result;
}
@@ -1498,8 +1496,7 @@ gtk_file_chooser_get_file (GtkFileChooser *chooser)
result = list->data;
list = g_slist_delete_link (list, list);
- g_slist_foreach (list, (GFunc) g_object_unref, NULL);
- g_slist_free (list);
+ g_slist_free_full (list, g_object_unref);
}
return result;
@@ -2064,8 +2061,7 @@ gtk_file_chooser_list_shortcut_folders (GtkFileChooser *chooser)
folders = _gtk_file_chooser_list_shortcut_folder_files (chooser);
result = files_to_strings (folders, g_file_get_path);
- g_slist_foreach (folders, (GFunc) g_object_unref, NULL);
- g_slist_free (folders);
+ g_slist_free_full (folders, g_object_unref);
return result;
}
@@ -2161,8 +2157,7 @@ gtk_file_chooser_list_shortcut_folder_uris (GtkFileChooser *chooser)
folders = _gtk_file_chooser_list_shortcut_folder_files (chooser);
result = files_to_strings (folders, g_file_get_uri);
- g_slist_foreach (folders, (GFunc) g_object_unref, NULL);
- g_slist_free (folders);
+ g_slist_free_full (folders, g_object_unref);
return result;
}