aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2021-01-19 11:48:36 +0100
committerSimon Ser <contact@emersion.fr>2021-01-19 11:56:31 +0100
commitf6fe43971876082b0c201696bf01dcd57de866c3 (patch)
tree9f4506df32a2db5f64c4b39bd540549efb3f1e81
parent702eed5cbd5a67ec0b0958638e193580fd0b3b55 (diff)
xdg-output: destroy outputs before manager
Since output_destroy() calls wl_list_remove() on the output's link, the manager must still be valid. This is the same bug fixed in bf926e3 but with a different interface.
-rw-r--r--types/wlr_xdg_output_v1.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/types/wlr_xdg_output_v1.c b/types/wlr_xdg_output_v1.c
index e81080ba..819ea6c6 100644
--- a/types/wlr_xdg_output_v1.c
+++ b/types/wlr_xdg_output_v1.c
@@ -227,6 +227,10 @@ static void handle_layout_change(struct wl_listener *listener, void *data) {
}
static void manager_destroy(struct wlr_xdg_output_manager_v1 *manager) {
+ struct wlr_xdg_output_v1 *output, *tmp;
+ wl_list_for_each_safe(output, tmp, &manager->outputs, link) {
+ output_destroy(output);
+ }
wlr_signal_emit_safe(&manager->events.destroy, manager);
wl_list_remove(&manager->display_destroy.link);
wl_list_remove(&manager->layout_add.link);