]> Pileus Git - ~andy/gtk/commitdiff
csscomputedvalues: Unref old value when setting new one
authorBenjamin Otte <otte@redhat.com>
Sat, 31 Mar 2012 01:35:48 +0000 (03:35 +0200)
committerBenjamin Otte <otte@redhat.com>
Sat, 7 Apr 2012 11:01:25 +0000 (13:01 +0200)
gtk/gtkcsscomputedvalues.c

index 305ff4fd415b6ee8eb9393918ffdf5a0fcf50f4f..37ad20b236e901ab17f58841897e26a89f0a29e5 100644 (file)
@@ -194,6 +194,8 @@ _gtk_css_computed_values_set_value (GtkCssComputedValues *values,
   if (id <= values->values->len)
    g_ptr_array_set_size (values->values, id + 1);
 
+  if (g_ptr_array_index (values->values, id))
+    _gtk_css_value_unref (g_ptr_array_index (values->values, id));
   g_ptr_array_index (values->values, id) = _gtk_css_value_ref (value);
 
   if (section)