[anjuta] sourceview: Don't check if objects are not NULL before calling g_clear_object().



commit 7d974c8cad5c9fc8538319fbd8524f8f416ab66e
Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
Date:   Tue Jan 1 18:09:12 2013 +0100

    sourceview: Don't check if objects are not NULL before calling g_clear_object().
    
    g_clear_object() does that itself so there's no need to do it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=690943

 plugins/sourceview/sourceview-prefs.c |   15 +++------------
 plugins/sourceview/sourceview.c       |    5 +----
 2 files changed, 4 insertions(+), 16 deletions(-)
---
diff --git a/plugins/sourceview/sourceview-prefs.c b/plugins/sourceview/sourceview-prefs.c
index d5dfca6..83f0792 100644
--- a/plugins/sourceview/sourceview-prefs.c
+++ b/plugins/sourceview/sourceview-prefs.c
@@ -341,16 +341,7 @@ sourceview_prefs_init(Sourceview* sv)
 
 void sourceview_prefs_destroy(Sourceview* sv)
 {
-	if (sv->priv->settings)
-	{
-		g_clear_object(&sv->priv->settings);
-	}
-	if (sv->priv->msgman_settings)
-	{
-		g_clear_object (&sv->priv->msgman_settings);
-	}
-	if (sv->priv->editor_settings)
-	{
-		g_clear_object (&sv->priv->editor_settings);
-	}
+	g_clear_object (&sv->priv->settings);
+	g_clear_object (&sv->priv->msgman_settings);
+	g_clear_object (&sv->priv->editor_settings);
 }
diff --git a/plugins/sourceview/sourceview.c b/plugins/sourceview/sourceview.c
index 46a4934..a15dc7e 100644
--- a/plugins/sourceview/sourceview.c
+++ b/plugins/sourceview/sourceview.c
@@ -898,10 +898,7 @@ sourceview_dispose(GObject *object)
 		g_clear_object (&cobj->priv->io);
 	}
 
-	if (cobj->priv->tooltip_cell)
-	{
-		g_clear_object (&cobj->priv->tooltip_cell);
-	}
+	g_clear_object (&cobj->priv->tooltip_cell);
 
 	sourceview_prefs_destroy(cobj);
 	



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