accessible: Ensure we unset the widget when finalizing

This commit is contained in:
Benjamin Otte 2011-12-18 17:29:31 +01:00
parent 03a63def24
commit dbc1581376

View 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,