]> Pileus Git - ~andy/gtk/commitdiff
accessible: Ensure we unset the widget when finalizing
authorBenjamin Otte <otte@redhat.com>
Sun, 18 Dec 2011 16:29:31 +0000 (17:29 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 19 Dec 2011 15:17:13 +0000 (16:17 +0100)
gtk/gtkaccessible.c

index bcd6cbb6256ad2ad35b1ccdba58d8a99f79a7810..afca739154fab0d4746022ca6a78ead4ffc20fd8 100644 (file)
@@ -129,6 +129,16 @@ gtk_accessible_real_widget_unset (GtkAccessible *accessible)
   atk_object_notify_state_change (ATK_OBJECT (accessible), ATK_STATE_DEFUNCT, TRUE);
 }
 
+static void
+gtk_accessible_finalize (GObject *object)
+{
+  GtkAccessible *accessible = GTK_ACCESSIBLE (object);
+  
+  gtk_accessible_set_widget (accessible, NULL);
+
+  G_OBJECT_CLASS (gtk_accessible_parent_class)->finalize (object);
+}
+
 static void
 gtk_accessible_class_init (GtkAccessibleClass *klass)
 {
@@ -142,6 +152,7 @@ gtk_accessible_class_init (GtkAccessibleClass *klass)
   atkobject_class->ref_state_set = gtk_accessible_ref_state_set;
   gobject_class->get_property = gtk_accessible_get_property;
   gobject_class->set_property = gtk_accessible_set_property;
+  gobject_class->finalize = gtk_accessible_finalize;
 
   g_object_class_install_property (gobject_class,
                                   PROP_WIDGET,