aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/layer_shell.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-03-31 15:17:32 -0400
committerGitHub <noreply@github.com>2018-03-31 15:17:32 -0400
commit543081ab1c050654a11b899f276b273acd91b43b (patch)
tree407b0e53e843fd15a9e0a7bc92e75e25c6af3b9b /sway/desktop/layer_shell.c
parent59f362196b84d6cf455b574d887ec3e0c3163eb3 (diff)
parent8aedc042eeaa95a7a0be7c1dd06e3739ee1c7bd4 (diff)
Merge pull request #1689 from emersion/destroy-output-segfaults
Fix two segfaults when destroying outputs
Diffstat (limited to 'sway/desktop/layer_shell.c')
-rw-r--r--sway/desktop/layer_shell.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c
index 5c96659a..c18f51c7 100644
--- a/sway/desktop/layer_shell.c
+++ b/sway/desktop/layer_shell.c
@@ -238,11 +238,12 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
wl_list_remove(&sway_layer->unmap.link);
wl_list_remove(&sway_layer->surface_commit.link);
if (sway_layer->layer_surface->output != NULL) {
+ struct sway_output *output = sway_layer->layer_surface->output->data;
+ arrange_layers(output);
+
wl_list_remove(&sway_layer->output_destroy.link);
}
- struct sway_output *output = sway_layer->layer_surface->output->data;
free(sway_layer);
- arrange_layers(output);
}
static void handle_map(struct wl_listener *listener, void *data) {