Fixed memory management in styles
[projects/chimara/chimara.git] / libchimara / style.c
index 9fc6b1e499fe38a907b182f9988c08fce0515221..4785b9086e4d3c1e1f9aa9fcd3775636f6ef1318 100644 (file)
@@ -376,6 +376,7 @@ style_init(ChimaraGlk *glk)
        for(i=0; i<style_NUMSTYLES; i++) {
                tag = gtk_text_tag_new(GLK_TAG_NAMES[i]);
                g_hash_table_insert(glk_text_grid_styles, (gchar*) GLK_TAG_NAMES[i], tag);
+               g_object_ref(tag); /* Add an extra reference since the tag is in two hashtables */
                g_hash_table_insert(glk_text_buffer_styles, (gchar*) GLK_TAG_NAMES[i], tag);
        }