summaryrefslogtreecommitdiff
path: root/tag_model.c
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-04-27 19:29:50 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2010-04-27 19:29:50 +0200
commit028ed2e30c373f706f3a5daaac80c5bfbd264009 (patch)
tree232edca7a23435c5a541eb0f41b921b6641270f2 /tag_model.c
parent8eadc6efa274a28848ca586d69055ee1953a2e49 (diff)
Fixed initialization of tag model children nodes.
Diffstat (limited to 'tag_model.c')
-rw-r--r--tag_model.c14
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));
+ }
}
}