summaryrefslogtreecommitdiff
path: root/gtk/gtkscale.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2016-05-15 14:18:09 -0400
committerMatthias Clasen <mclasen@redhat.com>2016-05-15 14:18:09 -0400
commit38f71172f89d4f80a5d852a7b822bb944ba82934 (patch)
treed259e0a9d16ea1de95ad2472d40720587bf65fbf /gtk/gtkscale.c
parentcd305c19702cc80f900a0922bce19bf0c926167a (diff)
downloadgtk+-38f71172f89d4f80a5d852a7b822bb944ba82934.tar.gz
scale: Avoid a crash
gtk_scale_get_layout was not careful enough, leading to a crash when opening the inspector on a scale.
Diffstat (limited to 'gtk/gtkscale.c')
-rw-r--r--gtk/gtkscale.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index fc0121de97..6d71292e14 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -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,