From b4a52c732dbf3863bd22535077a2506538f9a8ce Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Fri, 3 Jun 2022 11:56:29 +0300 Subject: [PATCH] compositor: Properly dispose of fullscreen views at shutdown While we can have multiple outputs, each with its own fullscreen view, we have a layer-per-output hence we can't really call layer_fini() in the output destruction as that what would result in an invalid link access. Handle those views destruction and with it, the fullscreen layer fini, in the finalize bit where all others are handled as well. This fixes a crash at shutdown, which could be seen when using multiple outputs, and probably quite problematic when handling a restart. Fixes: 43bdf9a42bac33df174d6ac7ff1ab2e15441c7b5 Bug-AGL: SPEC-4420 Signed-off-by: Marius Vlad Change-Id: I773890a24ad8ca2556c1d4ddda7f37ebae02c9de --- src/compositor.c | 1 - src/shell.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/compositor.c b/src/compositor.c index 5d8d300..2fb981b 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -86,7 +86,6 @@ handle_output_destroy(struct wl_listener *listener, void *data) output->fullscreen_view.fs->view = NULL; } - weston_layer_fini(&output->ivi->fullscreen); output->output = NULL; wl_list_remove(&output->output_destroy.link); } diff --git a/src/shell.c b/src/shell.c index dc857fc..c6cae10 100644 --- a/src/shell.c +++ b/src/shell.c @@ -782,6 +782,8 @@ ivi_shell_destroy_views_on_layer(struct weston_layer *layer) void ivi_shell_finalize(struct ivi_compositor *ivi) { + struct ivi_output *output; + ivi_shell_destroy_views_on_layer(&ivi->hidden); weston_layer_fini(&ivi->hidden); @@ -796,6 +798,14 @@ ivi_shell_finalize(struct ivi_compositor *ivi) ivi_shell_destroy_views_on_layer(&ivi->popup); weston_layer_fini(&ivi->popup); + + wl_list_for_each(output, &ivi->outputs, link) { + if (output->fullscreen_view.fs->view) { + weston_surface_destroy(output->fullscreen_view.fs->view->surface); + output->fullscreen_view.fs->view = NULL; + } + } + weston_layer_fini(&ivi->fullscreen); } static void -- 2.16.6