From 747dc65c2c8ac1b3ec21e254af2291cfdbb0074e Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 30 May 2011 19:04:22 +0200 Subject: [PATCH] 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. --- gtk/gtkcssprovider.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c index d433573381..4fe675921c 100644 --- a/gtk/gtkcssprovider.c +++ b/gtk/gtkcssprovider.c @@ -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);