remoting-plugin: Release and detach the head

This re-orders the disable/destroy shutdown sequence such that
lookup_remoted_output(), in remoting_output_disable(), would find a
remoting output.

Otherwise, without this, lookup_remoted_output() wouldn't find a
remoting output available when shutting down the compositor, ultimately
leading to a crash.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
Marius Vlad 2023-02-16 17:47:21 +02:00
parent d90533b8ad
commit c3270e887b
1 changed files with 2 additions and 1 deletions

View File

@ -636,6 +636,8 @@ remoting_output_destroy(struct weston_output *output)
struct remoted_output *remoted_output = lookup_remoted_output(output);
struct weston_mode *mode, *next;
weston_head_release(remoted_output->head);
wl_list_for_each_safe(mode, next, &output->mode_list, link) {
wl_list_remove(&mode->link);
free(mode);
@ -650,7 +652,6 @@ remoting_output_destroy(struct weston_output *output)
free(remoted_output->gst_pipeline);
wl_list_remove(&remoted_output->link);
weston_head_release(remoted_output->head);
free(remoted_output->head);
free(remoted_output);
}