diff options
author | Padraig O'Briain <padraigo@src.gnome.org> | 2001-10-09 14:01:44 +0000 |
---|---|---|
committer | Padraig O'Briain <padraigo@src.gnome.org> | 2001-10-09 14:01:44 +0000 |
commit | 159e654dbcc452614c67e2c7e58d3dbf44ba4fc5 (patch) | |
tree | bd5eb5f02699b9e61dd5153ace7b03f6ca5d4621 /atk | |
parent | a563bed2111e7e5c4309a37df031794ce0f75507 (diff) | |
download | atk-159e654dbcc452614c67e2c7e58d3dbf44ba4fc5.tar.gz |
Avoid leaking of AtkAttributeSet data structure; speed up code.
* atk/atktext.c (atk_attribute_set_free):
Avoid leaking of AtkAttributeSet data structure; speed up code.
Diffstat (limited to 'atk')
-rwxr-xr-x | atk/atktext.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/atk/atktext.c b/atk/atktext.c index f7cd043..f54501f 100755 --- a/atk/atktext.c +++ b/atk/atktext.c @@ -678,15 +678,20 @@ atk_text_set_caret_offset (AtkText *text, void atk_attribute_set_free(AtkAttributeSet *attrib_set) { - gint index; + GSList *temp; - if (attrib_set == NULL) - return; + temp = attrib_set; - for (index = 0; index < g_slist_length(attrib_set); index++) - { - g_free(((AtkAttribute*) (g_slist_nth(attrib_set,index)->data))->name); - g_free(((AtkAttribute*) (g_slist_nth(attrib_set,index)->data))->value); - } - g_slist_free(attrib_set); + while (temp != NULL) + { + AtkAttribute *att; + + att = temp->data; + + g_free (att->name); + g_free (att->value); + g_free (att); + temp = temp->next; + } + g_slist_free (attrib_set); } |