mirror of
https://github.com/NickHu/sway
synced 2024-12-28 22:23:30 +01:00
Fix segfault when reaping invisible workspaces
This commit is contained in:
parent
b28e6d2369
commit
88f08a42f3
2 changed files with 4 additions and 2 deletions
|
@ -79,7 +79,7 @@ struct sway_container *container_destroy(struct sway_container *cont) {
|
||||||
list_free(cont->marks);
|
list_free(cont->marks);
|
||||||
}
|
}
|
||||||
if (parent) {
|
if (parent) {
|
||||||
container_remove_child(cont);
|
parent = container_remove_child(cont);
|
||||||
}
|
}
|
||||||
if (cont->name) {
|
if (cont->name) {
|
||||||
free(cont->name);
|
free(cont->name);
|
||||||
|
|
|
@ -110,9 +110,11 @@ struct sway_container *container_reap_empty(struct sway_container *container) {
|
||||||
while (container->children->length == 0) {
|
while (container->children->length == 0) {
|
||||||
if (container->type == C_WORKSPACE) {
|
if (container->type == C_WORKSPACE) {
|
||||||
if (!workspace_is_visible(container)) {
|
if (!workspace_is_visible(container)) {
|
||||||
|
struct sway_container *parent = container->parent;
|
||||||
container_workspace_destroy(container);
|
container_workspace_destroy(container);
|
||||||
|
return parent;
|
||||||
}
|
}
|
||||||
break;
|
return container;
|
||||||
} else if (container->type == C_CONTAINER) {
|
} else if (container->type == C_CONTAINER) {
|
||||||
struct sway_container *parent = container->parent;
|
struct sway_container *parent = container->parent;
|
||||||
container_destroy(container);
|
container_destroy(container);
|
||||||
|
|
Loading…
Reference in a new issue