diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2019-02-09 13:01:58 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2019-02-09 13:01:58 (GMT) |
commit | 5863af232b8fc57de210702afe659a7383bb8840 (patch) | |
tree | 18e6fd0fb7be2f01d23cda34f8d7b3f29b1a250b /src/analysis/db | |
parent | 32bef30025f5e3f513c2b4936c0573cc3b629961 (diff) |
Fixed another batch of memory leaks.
Diffstat (limited to 'src/analysis/db')
-rw-r--r-- | src/analysis/db/collection.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/analysis/db/collection.c b/src/analysis/db/collection.c index 9c28c4a..0a617f3 100644 --- a/src/analysis/db/collection.c +++ b/src/analysis/db/collection.c @@ -149,6 +149,18 @@ static void g_db_collection_init(GDbCollection *collec) static void g_db_collection_dispose(GDbCollection *collec) { + if (collec->items != NULL) + { + g_list_free_full(collec->items, g_object_unref); + collec->items = NULL; + } + + if (collec->sorted != NULL) + { + g_list_free_full(collec->sorted, g_object_unref); + collec->sorted = NULL; + } + G_OBJECT_CLASS(g_db_collection_parent_class)->dispose(G_OBJECT(collec)); } @@ -1130,6 +1142,8 @@ bool g_db_collection_load_all_items(GDbCollection *collec, sqlite3 *db) result = g_db_item_load(new, values, count); result &= g_db_collection_add_item(G_DB_COLLECTION(collec), new); + g_object_unref(G_OBJECT(new)); + } /* Sortie propre */ |