diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-03-30 14:31:17 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-03-30 14:31:17 -0400 |
commit | 88f08a42f30c6d79adbc9c1d5d897113fcd3a6f4 (patch) | |
tree | 8616074124e558fb6787be9cb3336d61663d9a86 /sway/tree/layout.c | |
parent | b28e6d23698c98d616710c44a211a8121943b3ca (diff) |
Fix segfault when reaping invisible workspaces
Diffstat (limited to 'sway/tree/layout.c')
-rw-r--r-- | sway/tree/layout.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c index 32e6a77c..588ceb2d 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c @@ -110,9 +110,11 @@ struct sway_container *container_reap_empty(struct sway_container *container) { while (container->children->length == 0) { if (container->type == C_WORKSPACE) { if (!workspace_is_visible(container)) { + struct sway_container *parent = container->parent; container_workspace_destroy(container); + return parent; } - break; + return container; } else if (container->type == C_CONTAINER) { struct sway_container *parent = container->parent; container_destroy(container); |