From 9f4b97bb923ac2bdcf53734d51402c5571146f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 10 May 2024 17:28:17 +0200 Subject: [PATCH] girepository/girmodule: Cleanup the builder types hash keys We were adding new keys but never removing them, so use the proper destroy notify for them and clarify the ownership on the caller. --- girepository/girmodule.c | 2 +- girepository/girnode.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/girepository/girmodule.c b/girepository/girmodule.c index 6d1e89493..af416c3a2 100644 --- a/girepository/girmodule.c +++ b/girepository/girmodule.c @@ -374,7 +374,7 @@ gi_ir_module_build_typelib (GIIrModule *module) restart: gi_ir_node_init_stats (); strings = g_hash_table_new (g_str_hash, g_str_equal); - types = g_hash_table_new (g_str_hash, g_str_equal); + types = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); nodes_with_attributes = NULL; n_entries = g_list_length (module->entries); diff --git a/girepository/girnode.c b/girepository/girnode.c index b3ea89323..2bc84e8ba 100644 --- a/girepository/girnode.c +++ b/girepository/girnode.c @@ -1477,7 +1477,8 @@ gi_ir_node_build_typelib (GIIrNode *node, else { unique_types_count += 1; - g_hash_table_insert (types, s, GUINT_TO_POINTER(*offset2)); + g_hash_table_insert (types, g_steal_pointer (&s), + GUINT_TO_POINTER(*offset2)); blob->offset = *offset2; switch (type->tag)