Commit 747dc65c authored by Carlos Garnacho's avatar Carlos Garnacho

gtkcssprovider: Use g_slice_dup() to copy GValues around

GValues stored in GtkCssRulesets are gslice managed, so don't
g_memdup() GValues from shorthand properties. This fixes
memory corruptions when reloading contents in a GtkCssProvider.
parent 7a730ae2
......@@ -1086,9 +1086,9 @@ gtk_css_ruleset_add (GtkCssRuleset *ruleset,
{
const GtkStyleProperty *child;
GValue *value;
child = _gtk_style_property_lookup (parameters[i].name);
value = g_memdup (&parameters[i].value, sizeof (GValue));
value = g_slice_dup (GValue, &parameters[i].value);
gtk_css_ruleset_add (ruleset, child, value);
}
g_free (parameters);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment