]> Pileus Git - ~andy/gtk/commitdiff
csscomputedvalues: Unset the section when setting a new value
authorBenjamin Otte <otte@redhat.com>
Mon, 1 Oct 2012 08:32:59 +0000 (10:32 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 1 Oct 2012 08:32:59 +0000 (10:32 +0200)
Otherwise we end up with the wrong section if no new one is specified.

gtk/gtkcsscomputedvalues.c

index b60324eaa08e854a0bb334227f3810479c430a93..12424cc08332ab0600d61877bc73f991afb1b054 100644 (file)
@@ -195,6 +195,12 @@ _gtk_css_computed_values_set_value (GtkCssComputedValues *values,
   if (dependencies & (GTK_CSS_DEPENDS_ON_FONT_SIZE))
     values->depends_on_font_size = _gtk_bitmask_set (values->depends_on_font_size, id, TRUE);
 
+  if (values->sections && values->sections->len > id && g_ptr_array_index (values->sections, id))
+    {
+      gtk_css_section_unref (g_ptr_array_index (values->sections, id));
+      g_ptr_array_index (values->sections, id) = NULL;
+    }
+
   if (section)
     {
       if (values->sections == NULL)