From fca71ff4bbe0428638ee15a4f4ad9cf4a8f7d78b Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 8 Aug 2023 13:52:36 +0100 Subject: [PATCH] desktop-shell: Initialise lists earlier Make sure that we can exit cleanly if we have to fail. Signed-off-by: Daniel Stone --- desktop-shell/shell.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 989980bb..6d0d12b2 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -4769,7 +4769,6 @@ setup_output_destroy_handler(struct weston_compositor *ec, { struct weston_output *output; - wl_list_init(&shell->output_list); wl_list_for_each(output, &ec->output_list, link) create_shell_output(shell, output); @@ -5002,6 +5001,16 @@ wet_shell_init(struct weston_compositor *ec, wl_list_init(&shell->seat_list); wl_list_init(&shell->shsurf_list); + wl_list_init(&shell->output_list); + wl_list_init(&shell->output_create_listener.link); + wl_list_init(&shell->output_move_listener.link); + wl_list_init(&shell->seat_create_listener.link); + wl_list_init(&shell->resized_listener.link); + wl_list_init(&shell->workspace.focus_list); + wl_list_init(&shell->workspace.seat_destroyed_listener.link); + + weston_layer_init(&shell->minimized_layer, ec); + weston_layer_init(&shell->workspace.layer, ec); if (input_panel_setup(shell) < 0) return -1; @@ -5012,8 +5021,6 @@ wet_shell_init(struct weston_compositor *ec, workspace_create(shell); - weston_layer_init(&shell->minimized_layer, ec); - shell->desktop = weston_desktop_create(ec, &shell_desktop_api, shell); if (!shell->desktop) return -1;