diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2017-05-23 21:24:17 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2017-05-23 21:24:17 (GMT) |
commit | 3d2576f58690dc3069d918f5a737192028e45f8b (patch) | |
tree | bf7ba151d4e610d693dc552adc3aa2b8f1e62c42 | |
parent | 1c96d0ae943b45f71954c1772aa94f78bafdf656 (diff) |
Fixed memory leaks by destroying delayed works after processing.
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | src/analysis/disass/area.c | 2 | ||||
-rw-r--r-- | src/analysis/disass/output.c | 2 | ||||
-rw-r--r-- | src/glibext/delayed.c | 2 |
4 files changed, 16 insertions, 1 deletions
@@ -1,3 +1,14 @@ +17-05-23 Cyrille Bagard <nocbos@gmail.com> + + * src/analysis/disass/area.c: + Keep some collectors for later processing. + + * src/analysis/disass/output.c: + Delete all references to dead objects as intented. + + * src/glibext/delayed.c: + Fix memory leaks by destroying delayed works after processing. + 17-05-22 Cyrille Bagard <nocbos@gmail.com> * src/analysis/disass/area.c: diff --git a/src/analysis/disass/area.c b/src/analysis/disass/area.c index 030d58e..06893ff 100644 --- a/src/analysis/disass/area.c +++ b/src/analysis/disass/area.c @@ -1578,6 +1578,7 @@ mem_area *collect_memory_areas(wgroup_id_t gid, GtkStatusStack *status, GLoadedB collectors[i] = g_area_collector_new_intro(id, binary, first, last, closing); + g_object_ref(G_OBJECT(collectors[i])); g_work_queue_schedule_work(queue, G_DELAYED_WORK(collectors[i]), gid); } @@ -1944,6 +1945,7 @@ GArchInstruction **collect_disassembled_instructions(wgroup_id_t gid, GtkStatusS collectors[i] = g_area_collector_new_outro(id, list, begin, end); + g_object_ref(G_OBJECT(collectors[i])); g_work_queue_schedule_work(queue, G_DELAYED_WORK(collectors[i]), gid); } diff --git a/src/analysis/disass/output.c b/src/analysis/disass/output.c index 40cd12b..063280c 100644 --- a/src/analysis/disass/output.c +++ b/src/analysis/disass/output.c @@ -344,6 +344,8 @@ void print_disassembled_instructions(GBufferCache *cache, GCodingLanguage *lang, assert(comment_index == comment_count); + _g_preload_info_drain_comments(info); + g_preload_info_unlock_comments(info); gtk_status_stack_remove_activity(status, id); diff --git a/src/glibext/delayed.c b/src/glibext/delayed.c index 20f9d0f..ddd84a0 100644 --- a/src/glibext/delayed.c +++ b/src/glibext/delayed.c @@ -603,7 +603,7 @@ static void *g_work_group_process(GWorkGroup *group) g_delayed_work_process(work, group->status); - //g_object_unref(G_OBJECT(work)); // FIXME + g_object_unref(G_OBJECT(work)); if (g_atomic_int_dec_and_test(&group->pending)) g_cond_broadcast(&group->wait_cond); |