* atk/atktext.c (atk_attribute_set_free):
Avoid leaking of AtkAttributeSet data structure; speed up code.
+2001-10-09 Padraig O'Briain <padraig.obriain@sun.com>
+
+ * atk/atktext.c (atk_attribute_set_free):
+ Avoid leaking of AtkAttributeSet data structure; speed up code.
+
2001-10-01 jacob berkman <jacob@ximian.com>
* docs/Makefile.am (dist-hook-local): depend on all-local so that
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);
}