diff options
-rw-r--r-- | plugins/elf/loading.c | 2 | ||||
-rw-r--r-- | src/analysis/contents/restricted.c | 2 | ||||
-rw-r--r-- | src/analysis/disass/area.c | 6 | ||||
-rw-r--r-- | src/core/core.c | 11 | ||||
-rw-r--r-- | src/glibext/configuration.c | 13 |
5 files changed, 23 insertions, 11 deletions
diff --git a/plugins/elf/loading.c b/plugins/elf/loading.c index 73e75f0..782b5c7 100644 --- a/plugins/elf/loading.c +++ b/plugins/elf/loading.c @@ -214,7 +214,7 @@ static void g_elf_loading_init(GElfLoading *loading) static void g_elf_loading_dispose(GElfLoading *loading) { if (loading->kind == 2) - g_object_unref(G_OBJECT(loading->content)); + g_clear_object(&loading->content); G_OBJECT_CLASS(g_elf_loading_parent_class)->dispose(G_OBJECT(loading)); diff --git a/src/analysis/contents/restricted.c b/src/analysis/contents/restricted.c index 1c0c8e6..8e5242e 100644 --- a/src/analysis/contents/restricted.c +++ b/src/analysis/contents/restricted.c @@ -213,7 +213,7 @@ static void g_restricted_content_interface_init(GBinContentInterface *iface) static void g_restricted_content_dispose(GRestrictedContent *content) { - g_object_unref(G_OBJECT(content->internal)); + g_clear_object(&content->internal); G_OBJECT_CLASS(g_restricted_content_parent_class)->dispose(G_OBJECT(content)); diff --git a/src/analysis/disass/area.c b/src/analysis/disass/area.c index f1aa002..9649d6f 100644 --- a/src/analysis/disass/area.c +++ b/src/analysis/disass/area.c @@ -277,15 +277,17 @@ static void init_mem_area_from_addr(mem_area *area, const vmpa2t *addr, phys_t l area->format = G_BIN_FORMAT(g_loaded_binary_get_format(binary)); - content = g_binary_format_get_content(area->format); - area->proc = g_loaded_binary_get_processor(binary); area->endianness = g_arch_processor_get_endianness(area->proc); init_mrange(&area->range, addr, len); + content = g_binary_format_get_content(area->format); + area->content = g_restricted_content_new(content, &area->range); + g_object_unref(G_OBJECT(content)); + switch (g_arch_processor_get_instruction_min_size(area->proc)) { case MDS_4_BITS: diff --git a/src/core/core.c b/src/core/core.c index 5ce07d0..47e808d 100644 --- a/src/core/core.c +++ b/src/core/core.c @@ -131,12 +131,23 @@ bool load_all_basic_components(void) void unload_all_basic_components(void) { + GContentExplorer *explorer; /* Explorateur de contenus */ + GContentResolver *resolver; /* Résolveur de contenus */ + unload_collection_definitions(); unload_demanglers_definitions(); unload_processors_definitions(); + explorer = g_content_explorer_new(); + set_current_content_explorer(NULL); + g_object_unref(G_OBJECT(explorer)); + + resolver = g_content_resolver_new(); + set_current_content_resolver(NULL); + g_object_unref(G_OBJECT(resolver)); + exit_global_works(); g_generic_config_write(get_main_configuration()); diff --git a/src/glibext/configuration.c b/src/glibext/configuration.c index 0d3d011..03575b0 100644 --- a/src/glibext/configuration.c +++ b/src/glibext/configuration.c @@ -1146,14 +1146,13 @@ static void g_generic_config_init(GGenConfig *config) static void g_generic_config_dispose(GGenConfig *config) { - GList *iter; /* Boucle de parcours */ + g_list_free_full(config->groups, g_object_unref); - for (iter = g_list_first(config->params); - iter != NULL; - iter = g_list_next(iter)) - { - g_object_unref(G_OBJECT(iter->data)); - } + config->groups = NULL; + + g_list_free_full(config->params, g_object_unref); + + config->params = NULL; G_OBJECT_CLASS(g_generic_config_parent_class)->dispose(G_OBJECT(config)); |