grid: avoid a floating point exception

When a homogeneous grid has no visible children, we were
accidentally doing a division by zero. Instead, just bail
out early in this case, there is nothing to allocate anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=672763
This commit is contained in:
Matthias Clasen 2012-03-24 17:16:47 -04:00
parent cc6db27ff4
commit ed17c74f58

View File

@ -1020,6 +1020,9 @@ gtk_grid_request_allocate (GtkGridRequest *request,
gtk_grid_request_compute_expand (request, orientation, &nonempty, &expand);
if (nonempty == 0)
return;
linedata = &priv->linedata[orientation];
lines = &request->lines[orientation];