From ada524265fdcae827d67191b47e4c128c08c9d8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 9 Dec 2021 11:11:24 +0100 Subject: [PATCH] backend: Return NULL cursor renderer if there is no seat During tear down, if anything teared down after the seat tries to get the cursor renderer, we'd crash trying to get it as the seat would already be gone. Avoid this by returning NULL when there is no seat. It's assumed that any path that will happen during tear down that relies on getting the cursor renderer will gracefully handle it not being present, e.g. by relying on the cursor rendering cleaning up itself. Part-of: --- src/backends/meta-backend.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c index 77b99293e..369b03b1e 100644 --- a/src/backends/meta-backend.c +++ b/src/backends/meta-backend.c @@ -1238,6 +1238,9 @@ meta_backend_get_cursor_renderer (MetaBackend *backend) MetaBackendPrivate *priv = meta_backend_get_instance_private (backend); ClutterInputDevice *pointer; + if (!priv->default_seat) + return NULL; + pointer = clutter_seat_get_pointer (priv->default_seat); return meta_backend_get_cursor_renderer_for_device (backend, pointer);