mirror of
https://github.com/swaywm/sway.git
synced 2024-11-23 08:21:28 +00:00
Merge pull request #2097 from RyanDwyer/fix-workspace-segfault
Fix potential crash when destroying workspace
This commit is contained in:
commit
5c2ae9c600
|
@ -204,9 +204,17 @@ static struct sway_container *container_workspace_destroy(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free(workspace->sway_workspace);
|
struct sway_workspace *sway_workspace = workspace->sway_workspace;
|
||||||
|
|
||||||
|
// This emits the destroy event and also destroys the swayc.
|
||||||
_container_destroy(workspace);
|
_container_destroy(workspace);
|
||||||
|
|
||||||
|
// Clean up the floating container
|
||||||
|
sway_workspace->floating->parent = NULL;
|
||||||
|
_container_destroy(sway_workspace->floating);
|
||||||
|
|
||||||
|
free(sway_workspace);
|
||||||
|
|
||||||
if (output) {
|
if (output) {
|
||||||
output_damage_whole(output->sway_output);
|
output_damage_whole(output->sway_output);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue