mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-30 12:23:06 +02:00
glib/*: Use g_list_free_full()
This commit is contained in:
parent
928d2cea61
commit
2ae83e116b
@ -359,21 +359,8 @@ bookmark_metadata_free (BookmarkMetadata *metadata)
|
||||
|
||||
g_free (metadata->mime_type);
|
||||
|
||||
if (metadata->groups)
|
||||
{
|
||||
g_list_foreach (metadata->groups,
|
||||
(GFunc) g_free,
|
||||
NULL);
|
||||
g_list_free (metadata->groups);
|
||||
}
|
||||
|
||||
if (metadata->applications)
|
||||
{
|
||||
g_list_foreach (metadata->applications,
|
||||
(GFunc) bookmark_app_info_free,
|
||||
NULL);
|
||||
g_list_free (metadata->applications);
|
||||
}
|
||||
g_list_free_full (metadata->groups, g_free);
|
||||
g_list_free_full (metadata->applications, (GDestroyNotify) bookmark_app_info_free);
|
||||
|
||||
g_hash_table_destroy (metadata->apps_by_name);
|
||||
|
||||
@ -687,15 +674,8 @@ g_bookmark_file_clear (GBookmarkFile *bookmark)
|
||||
g_free (bookmark->title);
|
||||
g_free (bookmark->description);
|
||||
|
||||
if (bookmark->items)
|
||||
{
|
||||
g_list_foreach (bookmark->items,
|
||||
(GFunc) bookmark_item_free,
|
||||
NULL);
|
||||
g_list_free (bookmark->items);
|
||||
|
||||
bookmark->items = NULL;
|
||||
}
|
||||
g_list_free_full (bookmark->items, (GDestroyNotify) bookmark_item_free);
|
||||
bookmark->items = NULL;
|
||||
|
||||
if (bookmark->items_by_uri)
|
||||
{
|
||||
@ -2933,14 +2913,8 @@ g_bookmark_file_set_groups (GBookmarkFile *bookmark,
|
||||
if (!item->metadata)
|
||||
item->metadata = bookmark_metadata_new ();
|
||||
|
||||
if (item->metadata->groups != NULL)
|
||||
{
|
||||
g_list_foreach (item->metadata->groups,
|
||||
(GFunc) g_free,
|
||||
NULL);
|
||||
g_list_free (item->metadata->groups);
|
||||
item->metadata->groups = NULL;
|
||||
}
|
||||
g_list_free_full (item->metadata->groups, g_free);
|
||||
item->metadata->groups = NULL;
|
||||
|
||||
if (groups)
|
||||
{
|
||||
|
@ -3197,14 +3197,8 @@ g_key_file_set_top_comment (GKeyFile *key_file,
|
||||
/* Note all keys must be comments at the top of
|
||||
* the file, so we can just free it all.
|
||||
*/
|
||||
if (group->key_value_pairs != NULL)
|
||||
{
|
||||
g_list_foreach (group->key_value_pairs,
|
||||
(GFunc) g_key_file_key_value_pair_free,
|
||||
NULL);
|
||||
g_list_free (group->key_value_pairs);
|
||||
group->key_value_pairs = NULL;
|
||||
}
|
||||
g_list_free_full (group->key_value_pairs, (GDestroyNotify) g_key_file_key_value_pair_free);
|
||||
group->key_value_pairs = NULL;
|
||||
|
||||
if (comment == NULL)
|
||||
return TRUE;
|
||||
|
@ -356,8 +356,7 @@ void g_option_context_free (GOptionContext *context)
|
||||
{
|
||||
g_return_if_fail (context != NULL);
|
||||
|
||||
g_list_foreach (context->groups, (GFunc)g_option_group_free, NULL);
|
||||
g_list_free (context->groups);
|
||||
g_list_free_full (context->groups, (GDestroyNotify) g_option_group_free);
|
||||
|
||||
if (context->main_group)
|
||||
g_option_group_free (context->main_group);
|
||||
|
@ -835,8 +835,7 @@ g_match_info_expand_references (const GMatchInfo *match_info,
|
||||
result = g_string_sized_new (strlen (string_to_expand));
|
||||
interpolate_replacement (match_info, result, list);
|
||||
|
||||
g_list_foreach (list, (GFunc)free_interpolation_data, NULL);
|
||||
g_list_free (list);
|
||||
g_list_free_full (list, (GDestroyNotify) free_interpolation_data);
|
||||
|
||||
return g_string_free (result, FALSE);
|
||||
}
|
||||
@ -2062,8 +2061,7 @@ g_regex_split_full (const GRegex *regex,
|
||||
if (tmp_error != NULL)
|
||||
{
|
||||
g_propagate_error (error, tmp_error);
|
||||
g_list_foreach (list, (GFunc)g_free, NULL);
|
||||
g_list_free (list);
|
||||
g_list_free_full (list, g_free);
|
||||
match_info->pos = -1;
|
||||
return NULL;
|
||||
}
|
||||
@ -2385,8 +2383,7 @@ split_replacement (const gchar *replacement,
|
||||
start = p = expand_escape (replacement, p, data, error);
|
||||
if (p == NULL)
|
||||
{
|
||||
g_list_foreach (list, (GFunc)free_interpolation_data, NULL);
|
||||
g_list_free (list);
|
||||
g_list_free_full (list, (GDestroyNotify) free_interpolation_data);
|
||||
free_interpolation_data (data);
|
||||
|
||||
return NULL;
|
||||
@ -2617,8 +2614,7 @@ g_regex_replace (const GRegex *regex,
|
||||
if (tmp_error != NULL)
|
||||
g_propagate_error (error, tmp_error);
|
||||
|
||||
g_list_foreach (list, (GFunc)free_interpolation_data, NULL);
|
||||
g_list_free (list);
|
||||
g_list_free_full (list, (GDestroyNotify) free_interpolation_data);
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -2827,8 +2823,7 @@ g_regex_check_replacement (const gchar *replacement,
|
||||
if (has_references)
|
||||
*has_references = interpolation_list_needs_match (list);
|
||||
|
||||
g_list_foreach (list, (GFunc) free_interpolation_data, NULL);
|
||||
g_list_free (list);
|
||||
g_list_free_full (list, (GDestroyNotify) free_interpolation_data);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user