Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid crashing on too many containers #8606

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kennylevinsen
Copy link
Member

If far too many containers are created, they can become so small that their size calculations come out negative, leading to crashes on asserts.

Instead, set a lower bound for sizes and disable the container entirely if it goes below it, giving whatever space it used to the last container.

The splits are not recalculated, so currently the effect is that if all containers have the same width fraction, they keep getting narrower until at some point they all round to zero and the last container will be given all the available space.

A better behavior would have been if the additional container did not contribute to size and fraction calculations at all, but it's an extreme edge-case, anything is better than crashing, and this is easier to implement.

If far too many containers are created, they can become so small that
their size calculations come out negative, leading to crashes on
asserts.

Instead, set a lower bound for sizes and disable the container entirely
if it goes below it, giving whatever space it used to the last
container.

The splits are not recalculated, so currently the effect is that if all
containers have the same width fraction, they keep getting narrower
until at some point they all round to zero and the last container will
be given all the available space.

A better behavior would have been if the additional container did not
contribute to size and fraction calculations at all, but it's an extreme
edge-case, anything is better than crashing, and this is easier to
implement.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant