aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-04-13 09:19:04 -0400
committerGitHub <noreply@github.com>2018-04-13 09:19:04 -0400
commit3dd185ec04bd3e4e1e34799adc4d7c28e4ab880c (patch)
treeb27acb8f604bf5fc5cc39b927d3e62d748cf7313 /sway/tree/container.c
parenta5735c08c7c3d99c452ea87a591afef0f4c2f5d2 (diff)
parent2b34bf1882f24ebd8c87debb2e2223bc084736c3 (diff)
Merge pull request #1804 from martinetd/crashes
Fix crashes
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index ea1c93bb..c0067493 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -104,7 +104,7 @@ static void _container_destroy(struct sway_container *cont) {
if (cont->children != NULL && cont->children->length) {
// remove children until there are no more, container_destroy calls
// container_remove_child, which removes child from this container
- while (cont->children != NULL) {
+ while (cont->children != NULL && cont->children->length > 0) {
struct sway_container *child = cont->children->items[0];
container_remove_child(child);
_container_destroy(child);