diff options
author | emersion <contact@emersion.fr> | 2018-06-03 09:20:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-03 09:20:22 +0100 |
commit | 5c2ae9c60021ace8b5a599671f51935edd18a2ae (patch) | |
tree | 75384b8790f6497181cdf00a9b26073809b641d6 | |
parent | Merge pull request #2094 from emersion/damage-schedule (diff) | |
parent | Fix potential crash when destroying workspace (diff) | |
download | sway-5c2ae9c60021ace8b5a599671f51935edd18a2ae.tar.gz sway-5c2ae9c60021ace8b5a599671f51935edd18a2ae.tar.zst sway-5c2ae9c60021ace8b5a599671f51935edd18a2ae.zip |
Merge pull request #2097 from RyanDwyer/fix-workspace-segfault
Fix potential crash when destroying workspace
-rw-r--r-- | sway/tree/container.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index 9e70da09..d0d26631 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -204,9 +204,17 @@ static struct sway_container *container_workspace_destroy( | |||
204 | } | 204 | } |
205 | } | 205 | } |
206 | 206 | ||
207 | free(workspace->sway_workspace); | 207 | struct sway_workspace *sway_workspace = workspace->sway_workspace; |
208 | |||
209 | // This emits the destroy event and also destroys the swayc. | ||
208 | _container_destroy(workspace); | 210 | _container_destroy(workspace); |
209 | 211 | ||
212 | // Clean up the floating container | ||
213 | sway_workspace->floating->parent = NULL; | ||
214 | _container_destroy(sway_workspace->floating); | ||
215 | |||
216 | free(sway_workspace); | ||
217 | |||
210 | if (output) { | 218 | if (output) { |
211 | output_damage_whole(output->sway_output); | 219 | output_damage_whole(output->sway_output); |
212 | } | 220 | } |