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 | |
parent | Implement atomic layout updates for xwayland views (diff) | |
download | sway-a3976e2659ec3a90ba606ca5a93cfa8e78c410e1.tar.gz sway-a3976e2659ec3a90ba606ca5a93cfa8e78c410e1.tar.zst sway-a3976e2659ec3a90ba606ca5a93cfa8e78c410e1.zip |
Fix another crash when moving out of stacks or tabs
-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) { | |||
331 | con->destroying = true; | 331 | con->destroying = true; |
332 | list_add(server.destroying_containers, con); | 332 | list_add(server.destroying_containers, con); |
333 | 333 | ||
334 | if (!con->parent) { | ||
335 | return NULL; | ||
336 | } | ||
337 | |||
334 | return container_remove_child(con); | 338 | return container_remove_child(con); |
335 | } | 339 | } |
336 | 340 | ||
@@ -384,7 +388,7 @@ struct sway_container *container_flatten(struct sway_container *container) { | |||
384 | struct sway_container *child = container->children->items[0]; | 388 | struct sway_container *child = container->children->items[0]; |
385 | struct sway_container *parent = container->parent; | 389 | struct sway_container *parent = container->parent; |
386 | container_replace_child(container, child); | 390 | container_replace_child(container, child); |
387 | container_destroy(container); | 391 | container_destroy_noreaping(container); |
388 | container = parent; | 392 | container = parent; |
389 | } | 393 | } |
390 | return container; | 394 | return container; |