mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 14:10:30 +00:00
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.
This commit is contained in:
parent
7a730ae213
commit
747dc65c2c
@ -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 (¶meters[i].value, sizeof (GValue));
|
||||
value = g_slice_dup (GValue, ¶meters[i].value);
|
||||
gtk_css_ruleset_add (ruleset, child, value);
|
||||
}
|
||||
g_free (parameters);
|
||||
|
Loading…
Reference in New Issue
Block a user