[gtk/abolish-destroy: 22/30] statusbar: Use dispose instead of destroy
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/abolish-destroy: 22/30] statusbar: Use dispose instead of destroy
- Date: Tue, 5 May 2020 23:58:26 +0000 (UTC)
commit 327da3de9ac49020c31221579517716b6854ef4a
Author: Matthias Clasen <mclasen redhat com>
Date: Tue May 5 16:50:49 2020 -0400
statusbar: Use dispose instead of destroy
The destroy vfunc is going away.
gtk/gtkstatusbar.c | 24 ++++++++----------------
1 file changed, 8 insertions(+), 16 deletions(-)
---
diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c
index 2373843cef..c58406427a 100644
--- a/gtk/gtkstatusbar.c
+++ b/gtk/gtkstatusbar.c
@@ -125,7 +125,8 @@ enum
static void gtk_statusbar_update (GtkStatusbar *statusbar,
guint context_id,
const gchar *text);
-static void gtk_statusbar_destroy (GtkWidget *widget);
+
+static void gtk_statusbar_msg_free (GtkStatusbarMsg *msg);
static guint statusbar_signals[SIGNAL_LAST] = { 0 };
@@ -136,6 +137,12 @@ gtk_statusbar_dispose (GObject *object)
{
GtkStatusbar *self = GTK_STATUSBAR (object);
+ g_slist_free_full (self->messages, (GDestroyNotify) gtk_statusbar_msg_free);
+ self->messages = NULL;
+
+ g_slist_free_full (self->keys, g_free);
+ self->keys = NULL;
+
g_clear_pointer (&self->message_area, gtk_widget_unparent);
G_OBJECT_CLASS (gtk_statusbar_parent_class)->dispose (object);
@@ -149,7 +156,6 @@ gtk_statusbar_class_init (GtkStatusbarClass *class)
object_class->dispose = gtk_statusbar_dispose;
- widget_class->destroy = gtk_statusbar_destroy;
widget_class->grab_focus = gtk_widget_grab_focus_none;
widget_class->focus = gtk_widget_focus_child;
@@ -503,17 +509,3 @@ gtk_statusbar_get_message (GtkStatusbar *statusbar)
return gtk_label_get_label (GTK_LABEL (statusbar->label));
}
-
-static void
-gtk_statusbar_destroy (GtkWidget *widget)
-{
- GtkStatusbar *statusbar = GTK_STATUSBAR (widget);
-
- g_slist_free_full (statusbar->messages, (GDestroyNotify) gtk_statusbar_msg_free);
- statusbar->messages = NULL;
-
- g_slist_free_full (statusbar->keys, g_free);
- statusbar->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]