[Xfce4-commits] <xfce4-indicator-plugin:master> Cleaning some runtime GObject assert violations

Mark Trompell noreply at xfce.org
Mon Apr 23 09:08:02 CEST 2012


Updating branch refs/heads/master
         to 828eb61a4760446c97fd03403ff161d1875052db (commit)
       from 33611c045a346b61eb3c06ed40b099d2046455ab (commit)

commit 828eb61a4760446c97fd03403ff161d1875052db
Author: Andrzej <ndrwrdck at gmail.com>
Date:   Sun Apr 8 23:57:21 2012 +0900

    Cleaning some runtime GObject assert violations

 panel-plugin/indicator-button.c |   42 ++++++++++++--------------------------
 1 files changed, 13 insertions(+), 29 deletions(-)

diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c
index 9fc0e6f..6bca0c8 100644
--- a/panel-plugin/indicator-button.c
+++ b/panel-plugin/indicator-button.c
@@ -83,35 +83,18 @@ xfce_indicator_button_finalize (GObject *object)
   XfceIndicatorButton *button = XFCE_INDICATOR_BUTTON (object);
 
   if (button->label != NULL)
-    {
-      g_object_unref (G_OBJECT (button->label));
-      button->label = NULL;
-    }
+    g_object_unref (G_OBJECT (button->label));
   if (button->orig_icon != NULL)
-    {
-      g_object_unref (G_OBJECT (button->orig_icon));
-      button->orig_icon = NULL;
-    }
+    g_object_unref (G_OBJECT (button->orig_icon));
   if (button->icon != NULL)
-    {
-      g_object_unref (G_OBJECT (button->icon));
-      button->icon = NULL;
-    }
-  if (button->io != NULL)
-    {
-      g_object_unref (G_OBJECT (button->io));
-      button->io = NULL;
-    }
-  if (button->entry != NULL)
-    {
-      g_object_unref (G_OBJECT (button->entry));
-      button->entry = NULL;
-    }
+    g_object_unref (G_OBJECT (button->icon));
   if (button->menu != NULL)
-    {
-      g_object_unref (G_OBJECT (button->menu));
-      button->menu = NULL;
-    }
+    g_object_unref (G_OBJECT (button->menu));
+  /* IndicatorObjectEntry is not GObject */
+  /* if (button->entry != NULL) */
+  /*   g_object_unref (G_OBJECT (button->entry)); */
+  if (button->io != NULL)
+    g_object_unref (G_OBJECT (button->io));
 
   G_OBJECT_CLASS (xfce_indicator_button_parent_class)->finalize (object);
 }
@@ -432,10 +415,11 @@ xfce_indicator_button_new (IndicatorObject *io,
   XfceIndicatorButton *button = g_object_new (XFCE_TYPE_INDICATOR_BUTTON, NULL);
   button->io = io;
   button->entry = entry;
-  g_object_ref (G_OBJECT (button->io));
-  g_object_ref (G_OBJECT (button->entry));
+  if (button->io != NULL)
+    g_object_ref (G_OBJECT (button->io));
+  /* IndicatorObjectEntry is not GObject */
+  /* g_object_ref (G_OBJECT (button->entry)); */
   return GTK_WIDGET (button);
 }
 
 
-


More information about the Xfce4-commits mailing list