aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Primak <vyivel@eclair.cafe>2023-11-23 21:20:15 +0300
committerKirill Primak <vyivel@eclair.cafe>2023-11-23 21:20:46 +0300
commit78a09573af43f30765393b2aff9a90f4c92a1dc3 (patch)
tree2528df88e428c2185a0b1da4e99e5d2492aaa2ca
parent504b9491f05d3227d45ea6bcc9c347e1a6bf9586 (diff)
output: fix display destroy listener double removal
Fixes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3762
-rw-r--r--types/output/output.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/types/output/output.c b/types/output/output.c
index a2ae5002..8d2bb9c9 100644
--- a/types/output/output.c
+++ b/types/output/output.c
@@ -146,7 +146,6 @@ void wlr_output_create_global(struct wlr_output *output, struct wl_display *disp
}
wl_list_remove(&output->display_destroy.link);
- output->display_destroy.notify = handle_display_destroy;
wl_display_add_destroy_listener(display, &output->display_destroy);
}
@@ -443,7 +442,9 @@ void wlr_output_init(struct wlr_output *output, struct wlr_backend *backend,
}
wlr_addon_set_init(&output->addons);
+
wl_list_init(&output->display_destroy.link);
+ output->display_destroy.notify = handle_display_destroy;
if (state) {
output_apply_state(output, state);
@@ -455,10 +456,11 @@ void wlr_output_destroy(struct wlr_output *output) {
return;
}
- wl_list_remove(&output->display_destroy.link);
wlr_output_destroy_global(output);
output_clear_back_buffer(output);
+ wl_list_remove(&output->display_destroy.link);
+
wl_signal_emit_mutable(&output->events.destroy, output);
wlr_addon_set_finish(&output->addons);