diff options
author | Timm Bäder <mail@baedert.org> | 2017-08-28 11:07:35 +0200 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2017-08-28 11:17:47 +0200 |
commit | 8c0e5adaab3f38de31d44dd50bcc8179b17c8b4a (patch) | |
tree | 1ad186d7132199e31031e6c5199ae41e1d069083 | |
parent | 08393a647792d334565534775ae8eb25ef7283d4 (diff) | |
download | gtk+-8c0e5adaab3f38de31d44dd50bcc8179b17c8b4a.tar.gz |
headerbar: Avoid allocating 0 visible children
Ths avoids doing a bunch of work as well as passing 0 to g_alloca which
is undefined.
-rw-r--r-- | gtk/gtkheaderbar.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c index 5b8ca74abd..bfaf41bbc2 100644 --- a/gtk/gtkheaderbar.c +++ b/gtk/gtkheaderbar.c @@ -932,6 +932,10 @@ gtk_header_bar_size_allocate (GtkWidget *widget, direction = gtk_widget_get_direction (widget); nvis_children = count_visible_children (bar); + + if (nvis_children == 0) + return; + sizes = g_newa (GtkRequestedSize, nvis_children); width = allocation->width - nvis_children * priv->spacing; |