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.
This commit is contained in:
Marco Trevisan (Treviño) 2024-05-10 17:28:17 +02:00 committed by Philip Withnall
parent 1b8ef05321
commit 9f4b97bb92
2 changed files with 3 additions and 2 deletions

View File

@ -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);

View File

@ -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)