[gtksourceview] Use *list_free_full
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] Use *list_free_full
- Date: Sat, 1 Oct 2011 13:48:20 +0000 (UTC)
commit 21f28135aea0a0d500978c7e03ef35fce29f87b3
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Sat Oct 1 13:47:40 2011 +0200
Use *list_free_full
gtksourceview/gtksourcecompletionmodel.c | 4 +---
gtksourceview/gtksourcecontextengine.c | 23 ++++++++++-------------
gtksourceview/gtksourcegutter.c | 3 +--
gtksourceview/gtksourcelanguage-parser-1.c | 3 +--
gtksourceview/gtksourcelanguage-parser-2.c | 3 +--
gtksourceview/gtksourcelanguagemanager.c | 3 +--
gtksourceview/gtksourcestyleschememanager.c | 3 +--
7 files changed, 16 insertions(+), 26 deletions(-)
---
diff --git a/gtksourceview/gtksourcecompletionmodel.c b/gtksourceview/gtksourcecompletionmodel.c
index 25ba5fb..e4dd1dc 100644
--- a/gtksourceview/gtksourcecompletionmodel.c
+++ b/gtksourceview/gtksourcecompletionmodel.c
@@ -483,10 +483,8 @@ gtk_source_completion_model_dispose (GObject *object)
g_hash_table_destroy (model->priv->providers_info);
model->priv->providers_info = NULL;
}
-
- g_list_foreach (model->priv->store, (GFunc)proposal_node_free, NULL);
- g_list_free (model->priv->store);
+ g_list_free_full (model->priv->store, (GDestroyNotify)proposal_node_free);
model->priv->store = NULL;
model->priv->last = NULL;
diff --git a/gtksourceview/gtksourcecontextengine.c b/gtksourceview/gtksourcecontextengine.c
index dcff39f..6932928 100644
--- a/gtksourceview/gtksourcecontextengine.c
+++ b/gtksourceview/gtksourcecontextengine.c
@@ -3800,16 +3800,12 @@ context_unref (Context *context)
{
for (i = 0; i < context->definition->n_sub_patterns; ++i)
{
- g_slist_foreach (context->subpattern_context_classes[i],
- (GFunc)context_class_tag_free,
- NULL);
-
- g_slist_free (context->subpattern_context_classes[i]);
+ g_slist_free_full (context->subpattern_context_classes[i],
+ (GDestroyNotify)context_class_tag_free);
}
}
- g_slist_foreach (context->context_classes, (GFunc)context_class_tag_free, NULL);
- g_slist_free (context->context_classes);
+ g_slist_free_full (context->context_classes, (GDestroyNotify)context_class_tag_free);
g_free (context->subpattern_context_classes);
g_free (context->subpattern_tags);
@@ -3902,9 +3898,11 @@ context_thaw (Context *ctx)
else
{
GSList *children = NULL;
+
g_hash_table_foreach (ptr->u.hash,
(GHFunc) get_child_contexts_hash_cb,
&children);
+
g_slist_foreach (children, (GFunc) context_thaw, NULL);
g_slist_free (children);
}
@@ -6241,8 +6239,8 @@ context_definition_unref (ContextDefinition *definition)
if (sp_def->is_named)
g_free (sp_def->u.name);
- g_slist_foreach (sp_def->context_classes, (GFunc) gtk_source_context_class_free, NULL);
- g_slist_free (sp_def->context_classes);
+ g_slist_free_full (sp_def->context_classes,
+ (GDestroyNotify)gtk_source_context_class_free);
g_slice_free (SubPatternDefinition, sp_def);
sub_pattern_list = sub_pattern_list->next;
@@ -6253,11 +6251,10 @@ context_definition_unref (ContextDefinition *definition)
g_free (definition->default_style);
regex_unref (definition->reg_all);
- g_slist_foreach (definition->context_classes, (GFunc) gtk_source_context_class_free, NULL);
- g_slist_free (definition->context_classes);
+ g_slist_free_full (definition->context_classes,
+ (GDestroyNotify)gtk_source_context_class_free);
- g_slist_foreach (definition->children, (GFunc) definition_child_free, NULL);
- g_slist_free (definition->children);
+ g_slist_free_full (definition->children, (GDestroyNotify)definition_child_free);
g_slice_free (ContextDefinition, definition);
}
diff --git a/gtksourceview/gtksourcegutter.c b/gtksourceview/gtksourcegutter.c
index 1ac78a8..5f89866 100644
--- a/gtksourceview/gtksourcegutter.c
+++ b/gtksourceview/gtksourcegutter.c
@@ -257,8 +257,7 @@ gtk_source_gutter_dispose (GObject *object)
GtkSourceGutter *gutter = GTK_SOURCE_GUTTER (object);
gint i;
- g_list_foreach (gutter->priv->renderers, (GFunc)renderer_free, NULL);
- g_list_free (gutter->priv->renderers);
+ g_list_free_full (gutter->priv->renderers, (GDestroyNotify)renderer_free);
if (gutter->priv->view)
{
diff --git a/gtksourceview/gtksourcelanguage-parser-1.c b/gtksourceview/gtksourcelanguage-parser-1.c
index 4fa5eb0..7d358b4 100644
--- a/gtksourceview/gtksourcelanguage-parser-1.c
+++ b/gtksourceview/gtksourcelanguage-parser-1.c
@@ -487,8 +487,7 @@ parseKeywordList (xmlNodePtr cur,
g_free (beginning_regex),
g_free (end_regex);
- g_slist_foreach (list, (GFunc) xmlFree, NULL);
- g_slist_free (list);
+ g_slist_free_full (list, (GDestroyNotify)xmlFree);
ctx_data_add_simple_pattern (ctx_data, language, id, (gchar*) style, regex);
diff --git a/gtksourceview/gtksourcelanguage-parser-2.c b/gtksourceview/gtksourcelanguage-parser-2.c
index 3b4f3e9..a7c0cfc 100644
--- a/gtksourceview/gtksourcelanguage-parser-2.c
+++ b/gtksourceview/gtksourcelanguage-parser-2.c
@@ -850,8 +850,7 @@ handle_context_element (ParserState *parser_state)
g_free (id);
}
- g_slist_foreach (context_classes, (GFunc)gtk_source_context_class_free, NULL);
- g_slist_free (context_classes);
+ g_slist_free_full (context_classes, (GDestroyNotify)gtk_source_context_class_free);
g_free (style_ref);
xmlFree (sub_pattern);
diff --git a/gtksourceview/gtksourcelanguagemanager.c b/gtksourceview/gtksourcelanguagemanager.c
index 2fa350c..74871ce 100644
--- a/gtksourceview/gtksourcelanguagemanager.c
+++ b/gtksourceview/gtksourcelanguagemanager.c
@@ -378,8 +378,7 @@ ensure_languages (GtkSourceLanguageManager *lm)
lm->priv->ids = (gchar **)g_ptr_array_free (ids_array, FALSE);
}
- g_slist_foreach (filenames, (GFunc) g_free, NULL);
- g_slist_free (filenames);
+ g_slist_free_full (filenames, g_free);
}
diff --git a/gtksourceview/gtksourcestyleschememanager.c b/gtksourceview/gtksourcestyleschememanager.c
index 6db9274..a9fbfc4 100644
--- a/gtksourceview/gtksourcestyleschememanager.c
+++ b/gtksourceview/gtksourcestyleschememanager.c
@@ -382,8 +382,7 @@ reload_if_needed (GtkSourceStyleSchemeManager *mgr)
ids = check_parents (ids, schemes_hash);
- g_slist_foreach (files, (GFunc) g_free, NULL);
- g_slist_free (files);
+ g_slist_free_full (files, g_free);
free_schemes (mgr);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]