[PATCH] eel shouldn't mess around with ATK internals



eel seems to unref an object it never refed in
eel_accessibility_set_up_label_widget_relation, which is bad. Check out
atk_object_add_relationship for a clean implementation.

-- 
Christian Neumair <chris gnome-de org>
Index: eel/eel-accessibility.c
===================================================================
RCS file: /cvs/gnome/eel/eel/eel-accessibility.c,v
retrieving revision 1.12
diff -u -p -r1.12 eel-accessibility.c
--- eel/eel-accessibility.c	28 Mar 2005 19:51:00 -0000	1.12
+++ eel/eel-accessibility.c	30 Sep 2005 18:38:50 -0000
@@ -31,28 +31,15 @@ void
 eel_accessibility_set_up_label_widget_relation (GtkWidget *label, GtkWidget *widget)
 {
 	AtkObject *atk_widget, *atk_label;
-	AtkRelationSet *relation_set;
-	AtkRelation *relation;
-	AtkObject *targets[1];
 
 	atk_label = gtk_widget_get_accessible (label);
 	atk_widget = gtk_widget_get_accessible (widget);
 
 	/* Create the label -> widget relation */
-	relation_set = atk_object_ref_relation_set (atk_label);
-	targets[0] = atk_widget;
-	relation = atk_relation_new (targets, 1, ATK_RELATION_LABEL_FOR);
-	atk_relation_set_add (relation_set, relation);
-	g_object_unref (relation);
-	g_object_unref (relation_set);
+	atk_object_add_relationship (atk_label, ATK_RELATION_LABEL_FOR, atk_widget);
 
 	/* Create the widget -> label relation */
-	relation_set = atk_object_ref_relation_set (atk_widget);
-	targets[0] = atk_label;
-	relation = atk_relation_new (targets, 1, ATK_RELATION_LABELLED_BY);
-	atk_relation_set_add (relation_set, relation);
-	g_object_unref (relation);
-	g_object_unref (relation_set);
+	atk_object_add_relationship (atk_label, ATK_RELATION_LABELLED_BY, atk_widget);
 }
 
 /*

Attachment: signature.asc
Description: This is a digitally signed message part



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