scale: Avoid a crash

gtk_scale_get_layout was not careful enough, leading to a crash
when opening the inspector on a scale.
This commit is contained in:
Matthias Clasen 2016-05-15 14:18:09 -04:00
parent cd305c1970
commit 38f71172f8

View File

@ -1901,12 +1901,11 @@ gtk_scale_get_layout (GtkScale *scale)
priv = scale->priv;
if (!priv->layout)
if (!priv->layout && priv->draw_value)
{
int min_layout_width;
if (priv->draw_value)
priv->layout = gtk_widget_create_pango_layout (GTK_WIDGET (scale), NULL);
priv->layout = gtk_widget_create_pango_layout (GTK_WIDGET (scale), NULL);
gtk_css_gadget_get_preferred_size (priv->value_gadget,
GTK_ORIENTATION_HORIZONTAL, -1,