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 /src | |
parent | 1c96d0ae943b45f71954c1772aa94f78bafdf656 (diff) |
Fixed memory leaks by destroying delayed works after processing.
Diffstat (limited to 'src')
-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 |
3 files changed, 5 insertions, 1 deletions
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); |