diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-06-24 23:07:52 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-06-24 23:07:52 +1000 |
commit | a3976e2659ec3a90ba606ca5a93cfa8e78c410e1 (patch) | |
tree | 49c997af6fe70b1d0abde0c2cb14d74c2ba1d436 /sway/tree | |
parent | 1549fb719ae75a498bf319db45281464e72c759e (diff) |
Fix another crash when moving out of stacks or tabs
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/container.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index 075c508c..e30c7839 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -331,6 +331,10 @@ struct sway_container *container_destroy_noreaping(struct sway_container *con) { con->destroying = true; list_add(server.destroying_containers, con); + if (!con->parent) { + return NULL; + } + return container_remove_child(con); } @@ -384,7 +388,7 @@ struct sway_container *container_flatten(struct sway_container *container) { struct sway_container *child = container->children->items[0]; struct sway_container *parent = container->parent; container_replace_child(container, child); - container_destroy(container); + container_destroy_noreaping(container); container = parent; } return container; |