From 5db6d19e6bb4c72085104fcae9abf2f632d5f45a Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Thu, 16 Feb 2023 21:34:04 +0200 Subject: [PATCH] pipewire: Follow-up with remoting pluging when releasing the head Similarily to what the remoting plug-in does, explicitly call weston_release_head() before removing the output list entry. We do that to avoid lookup_pipewire_output() returning NULL and still find out the pipewire_output. Signed-off-by: Marius Vlad --- pipewire/pipewire-plugin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pipewire/pipewire-plugin.c b/pipewire/pipewire-plugin.c index 9a913aa3..629c66ec 100644 --- a/pipewire/pipewire-plugin.c +++ b/pipewire/pipewire-plugin.c @@ -310,6 +310,8 @@ pipewire_output_destroy(struct weston_output *base_output) struct pipewire_output *output = lookup_pipewire_output(base_output); struct weston_mode *mode, *next; + weston_head_release(output->head); + wl_list_for_each_safe(mode, next, &base_output->mode_list, link) { wl_list_remove(&mode->link); free(mode); @@ -318,7 +320,6 @@ pipewire_output_destroy(struct weston_output *base_output) pw_stream_destroy(output->stream); wl_list_remove(&output->link); - weston_head_release(output->head); free(output->head); free(output); }