[balsa] mime-widget: No need for a 'finalize' method



commit e01e656901803d98398a09e5044acb71be47cb7c
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Thu Feb 14 15:59:09 2019 -0500

    mime-widget: No need for a 'finalize' method
    
    All the members are widgets in containers, so they get destroyed anyway.

 src/balsa-mime-widget.c | 20 --------------------
 src/balsa-mime-widget.h |  1 -
 2 files changed, 21 deletions(-)
---
diff --git a/src/balsa-mime-widget.c b/src/balsa-mime-widget.c
index 6ba6e3127..d782f5c87 100644
--- a/src/balsa-mime-widget.c
+++ b/src/balsa-mime-widget.c
@@ -94,10 +94,7 @@ balsa_mime_widget_init (GTypeInstance *instance, gpointer g_class)
 static void
 balsa_mime_widget_class_init(BalsaMimeWidgetClass * klass)
 {
-    GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
     parent_class = g_type_class_ref(G_TYPE_OBJECT);
-    object_class->finalize = balsa_mime_widget_destroy;
 }
 
 
@@ -201,23 +198,6 @@ balsa_mime_widget_new(BalsaMessage * bm, LibBalsaMessageBody * mime_body, gpoint
 }
 
 
-void
-balsa_mime_widget_destroy(GObject * object)
-{
-    BalsaMimeWidget * mime_widget = BALSA_MIME_WIDGET(object);
-
-    if (mime_widget->container && mime_widget->container != mime_widget->widget)
-       gtk_widget_destroy(mime_widget->container);
-    mime_widget->container = NULL;
-    if (mime_widget->widget) {
-        g_object_unref(mime_widget->widget);
-        mime_widget->widget = NULL;
-    }
-
-    G_OBJECT_CLASS(parent_class)->finalize(object);
-}
-
-
 static BalsaMimeWidget *
 balsa_mime_widget_new_unknown(BalsaMessage * bm,
                              LibBalsaMessageBody * mime_body,
diff --git a/src/balsa-mime-widget.h b/src/balsa-mime-widget.h
index ac070dd7a..e08b151c8 100644
--- a/src/balsa-mime-widget.h
+++ b/src/balsa-mime-widget.h
@@ -68,7 +68,6 @@ GType balsa_mime_widget_get_type (void);
 BalsaMimeWidget *balsa_mime_widget_new(BalsaMessage * bm,
                                       LibBalsaMessageBody * mime_body,
                                       gpointer data);
-void balsa_mime_widget_destroy(GObject * object);
 void balsa_mime_widget_schedule_resize(GtkWidget * widget);
 
 


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