[gnome-shell] st-icon: Fix potential crash involving shadows



commit bdb3410d9d86a443718f153ed86f92622fd82bff
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Jul 11 20:26:11 2012 -0400

    st-icon: Fix potential crash involving shadows
    
    If the icon is painted before the new shadow is around, a stale
    shadow material will be painted with a NULL shadow spec, resulting
    in a crash.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679776

 src/st/st-icon.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/st/st-icon.c b/src/st/st-icon.c
index 9c2ac5e..ff75d32 100644
--- a/src/st/st-icon.c
+++ b/src/st/st-icon.c
@@ -302,6 +302,13 @@ st_icon_style_changed (StWidget *widget)
       st_shadow_unref (priv->shadow_spec);
       priv->shadow_spec = NULL;
     }
+
+  if (priv->shadow_material)
+    {
+      cogl_handle_unref (priv->shadow_material);
+      priv->shadow_material = COGL_INVALID_HANDLE;
+    }
+
   priv->shadow_spec = st_theme_node_get_shadow (theme_node, "icon-shadow");
 
   if (priv->shadow_spec && priv->shadow_spec->inset)



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