summaryrefslogtreecommitdiff
path: root/src/analysis/db/items
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-02-05 22:03:38 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-02-05 22:03:38 (GMT)
commit17f591f2230ac66394467d5e5eefe71cb259637d (patch)
tree1664e994b2904e5e9009027fc57749a11667365b /src/analysis/db/items
parentff187d24b7441e88e1f0361d59b0f6f55851791f (diff)
Fixed a huge number of memory leaks.
Diffstat (limited to 'src/analysis/db/items')
-rw-r--r--src/analysis/db/items/comment.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/analysis/db/items/comment.c b/src/analysis/db/items/comment.c
index b879d08..7eb7906 100644
--- a/src/analysis/db/items/comment.c
+++ b/src/analysis/db/items/comment.c
@@ -301,11 +301,10 @@ static void g_db_comment_dispose(GDbComment *comment)
{
size_t i; /* Boucle de parcours */
- for (i = 0; i < comment->old_count; i++)
- g_object_unref(G_OBJECT(comment->old_inlined[i]));
+ g_clear_object(&comment->previous);
- if (comment->old_inlined != NULL)
- free(comment->old_inlined);
+ for (i = 0; i < comment->old_count; i++)
+ g_clear_object(&comment->old_inlined[i]);
G_OBJECT_CLASS(g_db_comment_parent_class)->dispose(G_OBJECT(comment));
@@ -346,6 +345,9 @@ static void g_db_comment_finalize(GDbComment *comment)
unlock_flat_array(&comment->text);
+ if (comment->old_inlined != NULL)
+ free(comment->old_inlined);
+
G_OBJECT_CLASS(g_db_comment_parent_class)->finalize(G_OBJECT(comment));
}