summaryrefslogtreecommitdiff
path: root/src/fr-process.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2019-09-12 11:21:56 +0200
committerraveit65 <[email protected]>2019-09-22 02:44:09 +0200
commite5d2b428b86f3a09bbd035332698123971545d99 (patch)
treee22397390228d4b0099adf8ab64bd6bee67e4999 /src/fr-process.c
parent68ef9e00239ad3f20f78fb4822446dce62d58bab (diff)
downloadengrampa-e5d2b428b86f3a09bbd035332698123971545d99.tar.bz2
engrampa-e5d2b428b86f3a09bbd035332698123971545d99.tar.xz
Use g_list_free_full and g_slist_free_full
void g_list_free_full (GList *list, GDestroyNotify free_func); void g_slist_free_full (GList *list, GDestroyNotify free_func); Convenience methods, which free all the memory used by a list, and calls free_func on every element's data.
Diffstat (limited to 'src/fr-process.c')
-rw-r--r--src/fr-process.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/fr-process.c b/src/fr-process.c
index a5621a9..d82bacd 100644
--- a/src/fr-process.c
+++ b/src/fr-process.c
@@ -93,8 +93,7 @@ fr_command_info_free (FrCommandInfo *info)
return;
if (info->args != NULL) {
- g_list_foreach (info->args, (GFunc) g_free, NULL);
- g_list_free (info->args);
+ g_list_free_full (info->args, g_free);
info->args = NULL;
}
@@ -173,8 +172,7 @@ fr_channel_data_reset (FrChannelData *channel)
fr_channel_data_close_source (channel);
if (channel->raw != NULL) {
- g_list_foreach (channel->raw, (GFunc) g_free, NULL);
- g_list_free (channel->raw);
+ g_list_free_full (channel->raw, g_free);
channel->raw = NULL;
}
}