GtkCssProvider: free selector path on parse_rule().

This commit is contained in:
Carlos Garnacho 2010-04-21 01:51:46 +02:00
parent 07171d5f68
commit bc0af3208d

View File

@ -748,7 +748,8 @@ parse_selector (GtkCssProvider *css_provider,
{
SelectorPath *path;
*selector_out = NULL;
path = selector_path_new ();
*selector_out = path;
if (scanner->token != ':' &&
scanner->token != G_TOKEN_IDENTIFIER)
@ -774,11 +775,8 @@ parse_selector (GtkCssProvider *css_provider,
g_scanner_get_next_token (scanner);
if ((token = parse_nth_child (css_provider, scanner, path, &flags)) != G_TOKEN_NONE)
{
selector_path_unref (path);
return token;
}
}
selector_path_prepend_region (path, region_name, flags);
g_free (region_name);
@ -786,10 +784,7 @@ parse_selector (GtkCssProvider *css_provider,
else if (scanner->value.v_identifier[0] == '*')
selector_path_prepend_glob (path);
else
{
selector_path_unref (path);
return G_TOKEN_IDENTIFIER;
}
g_scanner_get_next_token (scanner);
@ -811,10 +806,7 @@ parse_selector (GtkCssProvider *css_provider,
g_scanner_get_next_token (scanner);
if (scanner->token != G_TOKEN_SYMBOL)
{
selector_path_unref (path);
return G_TOKEN_SYMBOL;
}
path->state = GPOINTER_TO_INT (scanner->value.v_symbol);
@ -883,7 +875,10 @@ parse_rule (GtkCssProvider *css_provider,
expected_token = parse_selector (css_provider, scanner, &selector);
if (expected_token != G_TOKEN_NONE)
{
selector_path_unref (selector);
return expected_token;
}
priv->cur_selectors = g_slist_prepend (priv->cur_selectors, selector);
@ -894,7 +889,10 @@ parse_rule (GtkCssProvider *css_provider,
expected_token = parse_selector (css_provider, scanner, &selector);
if (expected_token != G_TOKEN_NONE)
{
selector_path_unref (selector);
return expected_token;
}
priv->cur_selectors = g_slist_prepend (priv->cur_selectors, selector);
}