After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 477708 - atk_object_remove_relationship can remove more relationships than it should
atk_object_remove_relationship can remove more relationships than it should
Status: RESOLVED FIXED
Product: atk
Classification: Platform
Component: atk
1.9.x
Other Linux
: High normal
: ---
Assigned To: Li Yuan
Li Yuan
Depends on:
Blocks:
 
 
Reported: 2007-09-17 09:56 UTC by Andrey Tsyvarev
Modified: 2008-11-11 07:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (5.45 KB, patch)
2008-11-10 10:32 UTC, Li Yuan
committed Details | Review

Description Andrey Tsyvarev 2007-09-17 09:56:04 UTC
There can be errors if the relationships between objects are processed with both atk_object_add_relationship()/atk_object_remove_relationship(), atk_object_ref_relation_set() and then some function from AtkRelationSet.

Example:

relation_set = atk_object_ref_relation_set(obj);
atk_object_add_relationship(obj, type, target1);
atk_relation_set_add_relation_by_type(relation_set, type, target2);
atk_object_remove_relationship(obj, type, target1);

The <type,target1> relationship will be removed in this case but <type,target2> will be removed too, while it should not. 

The detailed bug description can be found at: 

http://linuxtesting.org/results/report?num=S0568
Comment 1 Li Yuan 2008-11-10 10:32:40 UTC
Created attachment 122315 [details] [review]
patch
Comment 2 Andrey Tsyvarev 2008-11-10 13:21:41 UTC
As I understand, after the patch there is no way to create AtkRelationSet with duplicating relation types? That's good.
According to code, all seems to be correct.
Is it intended to describe atk_relation_remove_target in the documentation?
Comment 3 Li Yuan 2008-11-11 07:22:42 UTC
Yes for both of your question :)


2008-11-10  Li Yuan  <li.yuan@sun.com>

        * atk/atkobject.c: (atk_object_remove_relationship):
        Bug #477708. Only remove the target, not the relation if
        there are still are targets.
        * atk/atkrelation.c: (atk_relation_remove_target):
        * atk/atkrelation.h: New API.
        * atk/atkrelationset.c: (atk_relation_set_add),
        (atk_relation_set_remove):
        Add/remove the new relation's targets to/from the existed
        relation if there has been a relation with the same type.
        * atk/atkstateset.c: (atk_state_set_or_sets):
        Bug #478595. Return NULL if sets are empty.