In atspi_match_rule_get_attributes, copy the hash rather than ref it
authorMike Gorse <mgorse@novell.com>
Tue, 17 May 2011 19:00:40 +0000 (14:00 -0500)
committerMike Gorse <mgorse@novell.com>
Tue, 17 May 2011 19:00:40 +0000 (14:00 -0500)
commit05237f4e33de73b6826807aef1bdfa7a0261821b
treebe168d40d9f3b6b0113fa45821f40548561ce8fa
parent288a8d842fd8ef84ee5bfcc68ac1808dd6a49838
In atspi_match_rule_get_attributes, copy the hash rather than ref it

It is not safe to ref a hash marked (transfer none) and expect its elements
to remain, since the caller will assume that it owns the elements and may
deallocate them (this is done by pygobject).  It would also be problematic
to simply mark the hash (transfer full), since we need to either assume that
the caller passed a destroy function when creating the hash (pygobject does
not) or deallocate the values ourselves when the match rule is finalized
(which requires making assumptions about the correct free function needed to
deallocate the values that the caller allocated).  So it seems that the only
safe thing to do is to copy the hash.
atspi/atspi-matchrule.c