cvs server: Diffing .
Index: glade-xml.c
===================================================================
RCS file: /cvs/gnome/libglade/glade/glade-xml.c,v
retrieving revision 1.107
diff -u -p -r1.107 glade-xml.c
--- glade-xml.c	23 Jan 2004 00:54:35 -0000	1.107
+++ glade-xml.c	19 Nov 2004 15:31:27 -0000
@@ -788,14 +788,22 @@ add_relation(AtkRelationSet *relations, 
     if (relation) {
 	/* add new target accessible to relation */
 	GPtrArray* target_array = atk_relation_get_target (relation);
+	GPtrArray* new_target_array;
+	AtkRelation *new_relation;
 	guint i;
 
 	/* first check if target occurs in array ... */
 	for (i = 0; i < target_array->len; i++)
 	    if (g_ptr_array_index(target_array, i) == target_accessible)
 		return;
-	g_object_ref(target_accessible);
-	g_ptr_array_add (target_array, target_accessible);
+        new_target_array = g_ptr_array_sized_new (target_array->len + 1);
+	for (i = 0; i < target_array->len; i++)
+	    g_ptr_array_add (new_target_array, g_ptr_array_index (target_array, i));
+	g_ptr_array_add (new_target_array, target_accessible);
+        new_relation = atk_relation_new (&g_ptr_array_index (new_target_array, 0), new_target_array->len, relation_type);
+	atk_relation_set_remove (relations, relation);
+	atk_relation_set_add (relations, new_relation);
+        g_ptr_array_free (new_target_array, TRUE);
     } else {
 	/* the relation hasn't been created yet ... */
 	relation = atk_relation_new(&target_accessible, 1, relation_type);
