summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2022-11-25 22:18:10 +0200
committerMarius Vlad <marius.vlad@collabora.com>2022-11-25 22:29:56 +0200
commit33997a7c96838795ccb586fc7fc43ce093210546 (patch)
tree1caa29a549c66676b4cea24aef66940429ef28b2
parentadf173ea334eafd233d168815078c4d199b08619 (diff)
compositor: Handle output destruction deferral
weston_head_detach() already handles the disable of the output if it's the last one. See also: https://gitlab.freedesktop.org/wayland/weston/-/issues/697 Bug-AGL: SPEC-4625 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: I542b14905b7b6aa220142d0d2dd5cec922c4fc33
-rw-r--r--src/compositor.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/compositor.c b/src/compositor.c
index 634c468..15fd42a 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -487,8 +487,21 @@ head_disable(struct ivi_compositor *ivi, struct weston_head *head)
weston_head_detach(head);
if (count_heads(ivi_output->output) == 0) {
- weston_output_disable(ivi_output->output);
+ if (ivi_output->output) {
+ /* ivi_output->output destruction may be deferred in
+ * some cases (see drm_output_destroy()), so we need to
+ * forcibly trigger the destruction callback now, or
+ * otherwise would later access data that we are about
+ * to free
+ */
+ struct weston_output *save = ivi_output->output;
+
+ handle_output_destroy(&ivi_output->output_destroy, save);
+ weston_output_destroy(save);
+ }
}
+ wl_list_remove(&ivi_output->link);
+ free(ivi_output);
}
static struct weston_config_section *