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 | |
parent | 32bef30025f5e3f513c2b4936c0573cc3b629961 (diff) |
Fixed another batch of memory leaks.
Diffstat (limited to 'src/analysis')
-rw-r--r-- | src/analysis/db/collection.c | 14 | ||||
-rw-r--r-- | src/analysis/project.c | 3 | ||||
-rw-r--r-- | src/analysis/routine.c | 6 |
3 files changed, 18 insertions, 5 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 */ diff --git a/src/analysis/project.c b/src/analysis/project.c index 6156fbc..57ebcc6 100644 --- a/src/analysis/project.c +++ b/src/analysis/project.c @@ -1345,6 +1345,9 @@ static void on_new_content_resolved(GContentResolver *resolver, wgroup_id_t wid, } + if (handler->filter != NULL) + handler->filter(NULL, handler->data); + } else diff --git a/src/analysis/routine.c b/src/analysis/routine.c index 8b49456..d206e5e 100644 --- a/src/analysis/routine.c +++ b/src/analysis/routine.c @@ -539,12 +539,8 @@ GDataType *g_binary_routine_get_return_type(const GBinRoutine *routine) void g_binary_routine_add_arg(GBinRoutine *routine, GBinVariable *var) { - routine->args_count++; + routine->args = realloc(routine->args, ++routine->args_count * sizeof(GBinVariable *)); - routine->args = (GBinVariable **)realloc(routine->args, - routine->args_count * sizeof(GBinVariable *)); - - g_object_ref(G_OBJECT(var)); routine->args[routine->args_count - 1] = var; } |