[gtk+/wip/cssvalue: 90/141] csscomputedvalues: Unref old value when setting new one



commit 08058369f37e99643141fccd5ad89aee7fc0d0e7
Author: Benjamin Otte <otte redhat com>
Date:   Sat Mar 31 03:35:48 2012 +0200

    csscomputedvalues: Unref old value when setting new one

 gtk/gtkcsscomputedvalues.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcsscomputedvalues.c b/gtk/gtkcsscomputedvalues.c
index 1f413ce..6b2ca8e 100644
--- a/gtk/gtkcsscomputedvalues.c
+++ b/gtk/gtkcsscomputedvalues.c
@@ -187,6 +187,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)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]