From bdb3410d9d86a443718f153ed86f92622fd82bff Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Wed, 11 Jul 2012 20:26:11 -0400 Subject: [PATCH] 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 file changed, 7 insertions(+) diff --git a/src/st/st-icon.c b/src/st/st-icon.c index 9c2ac5e91..ff75d32ec 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)