diff options
author | Matthias Clasen <mclasen@redhat.com> | 2016-01-26 22:11:54 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2016-01-26 22:11:54 -0500 |
commit | 8991f17d49c757fbef2739d9d16a03e029daebda (patch) | |
tree | ca402ae2383367b81e620328aa39ade3ee82976a /gtk | |
parent | 745624235b82301be2d1fdcae0c8fdc48df740c3 (diff) | |
download | gtk+-8991f17d49c757fbef2739d9d16a03e029daebda.tar.gz |
box gadget: Improve assertion message
Include the owner of the gadget in the assertion message,
to improve the chances of tracking down whats actually
going wrong here.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkboxgadget.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk/gtkboxgadget.c b/gtk/gtkboxgadget.c index ea18a21c28..1adbcb6774 100644 --- a/gtk/gtkboxgadget.c +++ b/gtk/gtkboxgadget.c @@ -133,7 +133,11 @@ gtk_box_gadget_distribute (GtkBoxGadget *gadget, size -= sizes[i].minimum_size; } - g_return_if_fail (size >= 0); + if G_UNLIKELY (size < 0) + { + g_critical ("%s: assertion 'size >= 0' failed in %s", G_STRFUNC, G_OBJECT_TYPE_NAME (gtk_css_gadget_get_owner (GTK_CSS_GADGET (gadget)))); + return; + } size = gtk_distribute_natural_allocation (size, priv->children->len, sizes); |