[gtk/wip/baedert/for-master: 1/15] statusbar: Stop implementing destroy()



commit b40ed4a86cf4e9daba53dbaccb57f116a5505374
Author: Timm Bäder <mail baedert org>
Date:   Wed Oct 2 13:15:59 2019 +0200

    statusbar: Stop implementing destroy()

 gtk/gtkstatusbar.c | 38 ++++++++++++++------------------------
 1 file changed, 14 insertions(+), 24 deletions(-)
---
diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c
index c214015a73..a07b73f00e 100644
--- a/gtk/gtkstatusbar.c
+++ b/gtk/gtkstatusbar.c
@@ -128,12 +128,19 @@ enum
 static void     gtk_statusbar_update            (GtkStatusbar      *statusbar,
                                                 guint              context_id,
                                                 const gchar       *text);
-static void     gtk_statusbar_destroy           (GtkWidget         *widget);
 
 static guint              statusbar_signals[SIGNAL_LAST] = { 0 };
 
 G_DEFINE_TYPE_WITH_PRIVATE (GtkStatusbar, gtk_statusbar, GTK_TYPE_WIDGET)
 
+
+static void
+gtk_statusbar_msg_free (GtkStatusbarMsg *msg)
+{
+  g_free (msg->text);
+  g_slice_free (GtkStatusbarMsg, msg);
+}
+
 static void
 gtk_statusbar_dispose (GObject *object)
 {
@@ -141,6 +148,12 @@ gtk_statusbar_dispose (GObject *object)
 
   g_clear_pointer (&priv->frame, gtk_widget_unparent);
 
+  g_slist_free_full (priv->messages, (GDestroyNotify) gtk_statusbar_msg_free);
+  priv->messages = NULL;
+
+  g_slist_free_full (priv->keys, g_free);
+  priv->keys = NULL;
+
   G_OBJECT_CLASS (gtk_statusbar_parent_class)->dispose (object);
 }
 
@@ -185,7 +198,6 @@ gtk_statusbar_class_init (GtkStatusbarClass *class)
 
   widget_class->measure = gtk_statusbar_measure;
   widget_class->size_allocate = gtk_statusbar_size_allocate;
-  widget_class->destroy = gtk_statusbar_destroy;
 
   class->text_pushed = gtk_statusbar_update;
   class->text_popped = gtk_statusbar_update;
@@ -335,13 +347,6 @@ gtk_statusbar_msg_create (GtkStatusbar *statusbar,
   return msg;
 }
 
-static void
-gtk_statusbar_msg_free (GtkStatusbarMsg *msg)
-{
-  g_free (msg->text);
-  g_slice_free (GtkStatusbarMsg, msg);
-}
-
 /**
  * gtk_statusbar_push:
  * @statusbar: a #GtkStatusbar
@@ -549,18 +554,3 @@ gtk_statusbar_get_message_area (GtkStatusbar *statusbar)
 
   return priv->message_area;
 }
-
-static void
-gtk_statusbar_destroy (GtkWidget *widget)
-{
-  GtkStatusbar *statusbar = GTK_STATUSBAR (widget);
-  GtkStatusbarPrivate *priv = gtk_statusbar_get_instance_private (statusbar);
-
-  g_slist_free_full (priv->messages, (GDestroyNotify) gtk_statusbar_msg_free);
-  priv->messages = NULL;
-
-  g_slist_free_full (priv->keys, g_free);
-  priv->keys = NULL;
-
-  GTK_WIDGET_CLASS (gtk_statusbar_parent_class)->destroy (widget);
-}


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