From 0ba5b694d38a343191de3a65c59e62b281d83125 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Thu, 16 Feb 2023 17:47:21 +0200 Subject: [PATCH] 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 (cherry picked from commit c3270e887bc07bb9c7d0e58e25d25e3a65145d2e) --- remoting/remoting-plugin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/remoting/remoting-plugin.c b/remoting/remoting-plugin.c index 0af43b5b..aabcd597 100644 --- a/remoting/remoting-plugin.c +++ b/remoting/remoting-plugin.c @@ -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); }