[gtk+] menubutton: Clear references in dispose, not finalize



commit 844e793246f4f0b31ee3dcebc64fffc058c576e1
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sun Jul 29 13:43:26 2012 -0300

    menubutton: Clear references in dispose, not finalize
    
    We need to do this here so that an explicit gtk_widget_destroy
    on either the widget or a container that holds it will kill the
    reference to the menu or model.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=680803

 gtk/gtkmenubutton.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkmenubutton.c b/gtk/gtkmenubutton.c
index 6aaada3..8a76361 100644
--- a/gtk/gtkmenubutton.c
+++ b/gtk/gtkmenubutton.c
@@ -64,7 +64,7 @@ enum
 
 G_DEFINE_TYPE(GtkMenuButton, gtk_menu_button, GTK_TYPE_TOGGLE_BUTTON)
 
-static void gtk_menu_button_finalize (GObject *object);
+static void gtk_menu_button_dispose (GObject *object);
 
 static void
 gtk_menu_button_set_property (GObject      *object,
@@ -367,7 +367,7 @@ gtk_menu_button_class_init (GtkMenuButtonClass *klass)
 
   gobject_class->set_property = gtk_menu_button_set_property;
   gobject_class->get_property = gtk_menu_button_get_property;
-  gobject_class->finalize = gtk_menu_button_finalize;
+  gobject_class->dispose = gtk_menu_button_dispose;
 
   widget_class->state_flags_changed = gtk_menu_button_state_flags_changed;
   widget_class->button_press_event = gtk_menu_button_button_press_event;
@@ -772,7 +772,7 @@ gtk_menu_button_get_direction (GtkMenuButton *menu_button)
 }
 
 static void
-gtk_menu_button_finalize (GObject *object)
+gtk_menu_button_dispose (GObject *object)
 {
   GtkMenuButtonPrivate *priv = GTK_MENU_BUTTON (object)->priv;
 
@@ -786,5 +786,5 @@ gtk_menu_button_finalize (GObject *object)
 
   g_clear_object (&priv->model);
 
-  G_OBJECT_CLASS (gtk_menu_button_parent_class)->finalize (object);
+  G_OBJECT_CLASS (gtk_menu_button_parent_class)->dispose (object);
 }



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