[gtk+/composite-templates] stylecontext: fix a StyleData refleak
- From: Juan Pablo Ugarte <jpu src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gtk+/composite-templates] stylecontext: fix a StyleData refleak
- Date: Sat,  6 Oct 2012 16:52:56 +0000 (UTC)
commit 37d89cbd4c432a30f0bf68b5fa2b489408b303fb
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Sep 13 13:48:43 2012 -0400
    stylecontext: fix a StyleData refleak
    
    We were failing to unref the style data in some code paths.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=683627
 gtk/gtkstylecontext.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 0b3cf04..63ac1de 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -3169,8 +3169,6 @@ _gtk_style_context_validate (GtkStyleContext  *context,
           data = style_data_lookup (context);
 
           changes = _gtk_css_computed_values_get_difference (data->store, current->store);
-
-          style_data_unref (current);
         }
       else
         {
@@ -3190,6 +3188,9 @@ _gtk_style_context_validate (GtkStyleContext  *context,
       gtk_style_context_update_cache (context, parent_changes);
     }
 
+  if (current)
+    style_data_unref (current);
+
   if (change & GTK_CSS_CHANGE_ANIMATE &&
       gtk_style_context_is_animating (context))
     {
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]