compositor: Fix removal of an output

This uses the more safer version of signal emission to avoid a potential
crash when the output is destroyed that will follow a surface/view
destruction for which it has a listener attached (to the output_destroy
signal).

Fixes: #734

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
dev
Marius Vlad 3 years ago committed by Daniel Stone
parent fa48c5ee41
commit 2015dfc325
  1. 4
      libweston/compositor.c

@ -6414,8 +6414,8 @@ weston_compositor_remove_output(struct weston_output *output)
wl_list_insert(compositor->pending_output_list.prev, &output->link); wl_list_insert(compositor->pending_output_list.prev, &output->link);
output->enabled = false; output->enabled = false;
wl_signal_emit(&compositor->output_destroyed_signal, output); weston_signal_emit_mutable(&compositor->output_destroyed_signal, output);
wl_signal_emit(&output->destroy_signal, output); weston_signal_emit_mutable(&output->destroy_signal, output);
wl_list_for_each(head, &output->head_list, output_link) wl_list_for_each(head, &output->head_list, output_link)
weston_head_remove_global(head); weston_head_remove_global(head);

Loading…
Cancel
Save