[gtksourceview] SearchContext: use g_clear_error()



commit ca23adc42887619b78b2c7f60e4858fd67b53b23
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Mon Jun 13 11:19:52 2016 +0200

    SearchContext: use g_clear_error()

 gtksourceview/gtksourcesearchcontext.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/gtksourceview/gtksourcesearchcontext.c b/gtksourceview/gtksourcesearchcontext.c
index 316fcda..04f568f 100644
--- a/gtksourceview/gtksourcesearchcontext.c
+++ b/gtksourceview/gtksourcesearchcontext.c
@@ -542,8 +542,7 @@ clear_search (GtkSourceSearchContext *search)
 
        if (search->priv->regex_error != NULL)
        {
-               g_error_free (search->priv->regex_error);
-               search->priv->regex_error = NULL;
+               g_clear_error (&search->priv->regex_error);
                g_object_notify (G_OBJECT (search), "regex-error");
        }
 
@@ -2280,8 +2279,7 @@ update_regex (GtkSourceSearchContext *search)
 
        if (search->priv->regex_error != NULL)
        {
-               g_error_free (search->priv->regex_error);
-               search->priv->regex_error = NULL;
+               g_clear_error (&search->priv->regex_error);
                regex_error_changed = TRUE;
        }
 
@@ -2602,10 +2600,7 @@ gtk_source_search_context_finalize (GObject *object)
                g_regex_unref (search->priv->regex);
        }
 
-       if (search->priv->regex_error != NULL)
-       {
-               g_error_free (search->priv->regex_error);
-       }
+       g_clear_error (&search->priv->regex_error);
 
        G_OBJECT_CLASS (gtk_source_search_context_parent_class)->finalize (object);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]