mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-01 00:11:29 +00:00
gtkcssselector: Don't leak the hash table
We should probably free the memory we allocate. Sounds like a winning strategy.
This commit is contained in:
parent
4ca293e006
commit
736ccb6ce1
@ -1895,7 +1895,7 @@ alloc_tree (GByteArray *array, gint32 *offset)
|
|||||||
static gint32
|
static gint32
|
||||||
subdivide_infos (GByteArray *array, GList *infos, gint32 parent_offset)
|
subdivide_infos (GByteArray *array, GList *infos, gint32 parent_offset)
|
||||||
{
|
{
|
||||||
GHashTable *ht = gtk_css_selectors_count_initial_init ();
|
GHashTable *ht;
|
||||||
GList *l;
|
GList *l;
|
||||||
GList *matched;
|
GList *matched;
|
||||||
GList *remaining;
|
GList *remaining;
|
||||||
@ -1912,6 +1912,8 @@ subdivide_infos (GByteArray *array, GList *infos, gint32 parent_offset)
|
|||||||
if (infos == NULL)
|
if (infos == NULL)
|
||||||
return GTK_CSS_SELECTOR_TREE_EMPTY_OFFSET;
|
return GTK_CSS_SELECTOR_TREE_EMPTY_OFFSET;
|
||||||
|
|
||||||
|
ht = gtk_css_selectors_count_initial_init ();
|
||||||
|
|
||||||
for (l = infos; l != NULL; l = l->next)
|
for (l = infos; l != NULL; l = l->next)
|
||||||
{
|
{
|
||||||
info = l->data;
|
info = l->data;
|
||||||
@ -1989,6 +1991,7 @@ subdivide_infos (GByteArray *array, GList *infos, gint32 parent_offset)
|
|||||||
|
|
||||||
g_list_free (matched);
|
g_list_free (matched);
|
||||||
g_list_free (remaining);
|
g_list_free (remaining);
|
||||||
|
g_hash_table_free (ht);
|
||||||
|
|
||||||
return tree_offset;
|
return tree_offset;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user