Fix duplicated id detection in gtkbuilder
Fix memory handling of duplicated id hashtable and add unit test
This commit is contained in:
@ -404,7 +404,8 @@ parse_object (GMarkupParseContext *context,
|
||||
return;
|
||||
}
|
||||
|
||||
g_hash_table_insert (data->object_ids, object_id, GINT_TO_POINTER (line));
|
||||
|
||||
g_hash_table_insert (data->object_ids, g_strdup (object_id), GINT_TO_POINTER (line));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1128,7 +1129,8 @@ _gtk_builder_parser_parse_buffer (GtkBuilder *builder,
|
||||
data->builder = builder;
|
||||
data->filename = filename;
|
||||
data->domain = g_strdup (domain);
|
||||
data->object_ids = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
data->object_ids = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
(GDestroyNotify)g_free, NULL);
|
||||
|
||||
data->requested_objects = NULL;
|
||||
if (requested_objs)
|
||||
|
Reference in New Issue
Block a user