[network-manager-applet] applet: simplify mobile broadband menu item finalization



commit 8beedc3e565b343aeb36aed96741044040011c3d
Author: Dan Williams <dcbw redhat com>
Date:   Mon Feb 16 15:07:58 2015 -0600

    applet: simplify mobile broadband menu item finalization

 src/mb-menu-item.c |   22 ++++------------------
 1 files changed, 4 insertions(+), 18 deletions(-)
---
diff --git a/src/mb-menu-item.c b/src/mb-menu-item.c
index ee471e2..4f204f1 100644
--- a/src/mb-menu-item.c
+++ b/src/mb-menu-item.c
@@ -42,8 +42,6 @@ typedef struct {
        guint32    int_strength;
        GtkWidget *detail;
        GtkWidget *hbox;
-
-       gboolean   destroyed;
 } NMMbMenuItemPrivate;
 
 static const char *
@@ -216,23 +214,11 @@ nm_mb_menu_item_init (NMMbMenuItem *self)
 }
 
 static void
-dispose (GObject *object)
+finalize (GObject *object)
 {
-       NMMbMenuItem *self = NM_MB_MENU_ITEM (object);
-       NMMbMenuItemPrivate *priv = NM_MB_MENU_ITEM_GET_PRIVATE (self);
-
-       if (priv->destroyed) {
-               G_OBJECT_CLASS (nm_mb_menu_item_parent_class)->dispose (object);
-               return;
-       }
-       priv->destroyed = TRUE;
-
-       gtk_widget_destroy (priv->desc);
-       gtk_widget_destroy (priv->strength);
-       gtk_widget_destroy (priv->hbox);
-       g_free (priv->desc_string);
+       g_free (NM_MB_MENU_ITEM_GET_PRIVATE (object)->desc_string);
 
-       G_OBJECT_CLASS (nm_mb_menu_item_parent_class)->dispose (object);
+       G_OBJECT_CLASS (nm_mb_menu_item_parent_class)->finalize (object);
 }
 
 static void
@@ -243,6 +229,6 @@ nm_mb_menu_item_class_init (NMMbMenuItemClass *klass)
        g_type_class_add_private (klass, sizeof (NMMbMenuItemPrivate));
 
        /* virtual methods */
-       object_class->dispose = dispose;
+       object_class->finalize = finalize;
 }
 


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