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!
This commit is contained in:
Benjamin Otte 2016-12-23 23:16:30 +01:00
parent 89d38ae93f
commit 1d84555729

View File

@ -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,