Commit 38f71172 authored by Matthias Clasen's avatar Matthias Clasen

scale: Avoid a crash

gtk_scale_get_layout was not careful enough, leading to a crash
when opening the inspector on a scale.
parent cd305c19
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment