diff options
-rw-r--r-- | tag_model.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tag_model.c b/tag_model.c index 8144e4c..0ba33ef 100644 --- a/tag_model.c +++ b/tag_model.c @@ -86,12 +86,15 @@ static void tag_model_init_children(TagModelRecord *record) { temp.children = NULL; temp.pos = i; - g_array_append_val(record->children, temp); - tag_model_init_children(&g_array_index(record->children, TagModelRecord, temp.pos)); - g_free(tag->name); + + g_array_append_val(record->children, temp); } g_array_free(array, TRUE); + + for(int i = 0; i < record->children->len; i++) { + tag_model_init_children(&g_array_index(record->children, TagModelRecord, i)); + } } } @@ -127,10 +130,13 @@ static void tag_model_init(TagModel *tag_model) { g_free(tag->name); g_array_append_val(tag_model->rows, temp); - tag_model_init_children(&g_array_index(tag_model->rows, TagModelRecord, tag_model->num_rows)); tag_model->num_rows++; } g_array_free(array, TRUE); + + for(int i = 0; i < tag_model->rows->len; i++) { + tag_model_init_children(&g_array_index(tag_model->rows, TagModelRecord, i)); + } } } |