From 1d845557297ddd114bb6e2c8d2332895967c9d42 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 23 Dec 2016 23:16:30 +0100 Subject: [PATCH] iconhelper: Invalidate style before accessing texture Invalidating the style might cause invalidation of the texture. So we end up with a pointer to freed memory. SAD! --- gtk/gtkiconhelper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk/gtkiconhelper.c b/gtk/gtkiconhelper.c index 82576fd7ba..9f3cdb1fd6 100644 --- a/gtk/gtkiconhelper.c +++ b/gtk/gtkiconhelper.c @@ -873,13 +873,13 @@ gtk_icon_helper_snapshot (GtkIconHelper *self, GtkCssStyle *style; GskTexture *texture; + style = gtk_css_node_get_style (gtk_css_gadget_get_node (GTK_CSS_GADGET (self))); + gtk_icon_helper_ensure_texture (self); texture = self->priv->texture; if (texture == NULL) return; - style = gtk_css_node_get_style (gtk_css_gadget_get_node (GTK_CSS_GADGET (self))); - gtk_css_style_snapshot_icon_texture (style, snapshot, texture,