From d08a5b2010f6e6feb1642ebf8e8444c4091d70dc Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Wed, 21 Sep 2022 19:44:52 +0300 Subject: [PATCH] desktop: Do not attempt to send terminate event For cases where the shell client itself is stopped/terminated or the compositor is taken down, and implicitly with it, the shell client we won't really have a reasource available. Use the shell_ready flag to verify that. Fixes: 0512e7251611e7040c55 Bug-AGL: SPEC-4528 Signed-off-by: Marius Vlad Change-Id: I78b4fb39a76402535e642dda9cf284b57856376d --- src/desktop.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/desktop.c b/src/desktop.c index f28d0c9..0e71de9 100644 --- a/src/desktop.c +++ b/src/desktop.c @@ -370,7 +370,9 @@ skip_output_asignment: shell_advertise_app_state(output->ivi, app_id, NULL, AGL_SHELL_DESKTOP_APP_STATE_DESTROYED); - if (wl_resource_get_version(output->ivi->shell_client.resource) >= AGL_SHELL_APP_STATE_SINCE_VERSION) + if (output->ivi->shell_client.ready && + wl_resource_get_version(output->ivi->shell_client.resource) + >= AGL_SHELL_APP_STATE_SINCE_VERSION) agl_shell_send_app_state(output->ivi->shell_client.resource, app_id, AGL_SHELL_APP_STATE_TERMINATED); } -- 2.16.6