Fix some memory leakage
authorMarijn van Vliet <w.m.vanvliet@student.utwente.nl>
Thu, 3 Nov 2011 14:36:37 +0000 (15:36 +0100)
committerMarijn van Vliet <w.m.vanvliet@student.utwente.nl>
Thu, 3 Nov 2011 14:36:37 +0000 (15:36 +0100)
libchimara/style.c

index f94407152dec4b71c1e235af088fe9d0944101d0..f9b231bf40bd4aff4e6a425b096b6578a12f212e 100644 (file)
@@ -1120,19 +1120,21 @@ get_current_font(guint32 wintype)
        text_tag_to_attr_list( g_hash_table_lookup(styles, "default"), list );
        PangoAttrIterator *it = pango_attr_list_get_iterator(list);
        pango_attr_iterator_get_font(it, font, NULL, NULL);
+       pango_attr_iterator_destroy(it);
 
        text_tag_to_attr_list( g_hash_table_lookup(styles, "normal"), list );
        it = pango_attr_list_get_iterator(list);
        pango_attr_iterator_get_font(it, font, NULL, NULL);
+       pango_attr_iterator_destroy(it);
 
        text_tag_to_attr_list( g_hash_table_lookup(glk_styles, "glk-normal"), list );
        it = pango_attr_list_get_iterator(list);
        pango_attr_iterator_get_font(it, font, NULL, NULL);
+       pango_attr_iterator_destroy(it);
 
        /* Make a copy of the family, preventing it's destruction at the end of this function. */
        pango_font_description_set_family( font, pango_font_description_get_family(font) );
 
-       pango_attr_iterator_destroy(it);
        pango_attr_list_unref(list);
 
        return font;