aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-03-30 14:31:17 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2018-03-30 14:31:17 -0400
commit88f08a42f30c6d79adbc9c1d5d897113fcd3a6f4 (patch)
tree8616074124e558fb6787be9cb3336d61663d9a86 /sway
parentIPC fixes (diff)
downloadsway-88f08a42f30c6d79adbc9c1d5d897113fcd3a6f4.tar.gz
sway-88f08a42f30c6d79adbc9c1d5d897113fcd3a6f4.tar.zst
sway-88f08a42f30c6d79adbc9c1d5d897113fcd3a6f4.zip
Fix segfault when reaping invisible workspaces
Diffstat (limited to 'sway')
-rw-r--r--sway/tree/container.c2
-rw-r--r--sway/tree/layout.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 778108b4..c3cf6c64 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -79,7 +79,7 @@ struct sway_container *container_destroy(struct sway_container *cont) {
79 list_free(cont->marks); 79 list_free(cont->marks);
80 } 80 }
81 if (parent) { 81 if (parent) {
82 container_remove_child(cont); 82 parent = container_remove_child(cont);
83 } 83 }
84 if (cont->name) { 84 if (cont->name) {
85 free(cont->name); 85 free(cont->name);
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) {
110 while (container->children->length == 0) { 110 while (container->children->length == 0) {
111 if (container->type == C_WORKSPACE) { 111 if (container->type == C_WORKSPACE) {
112 if (!workspace_is_visible(container)) { 112 if (!workspace_is_visible(container)) {
113 struct sway_container *parent = container->parent;
113 container_workspace_destroy(container); 114 container_workspace_destroy(container);
115 return parent;
114 } 116 }
115 break; 117 return container;
116 } else if (container->type == C_CONTAINER) { 118 } else if (container->type == C_CONTAINER) {
117 struct sway_container *parent = container->parent; 119 struct sway_container *parent = container->parent;
118 container_destroy(container); 120 container_destroy(container);