core: Short-circuit assign_outputs() during shutdown

If we're shutting down, moving surfaces to a different output will not
be profitable. Just clear out the output mask entirely and return early.

This specifically avoids the following issue seen with the Wayland
backend when shutting down:
  - outputs destroyed
  - colour manager destroyed
  - seats destroyed
  - pointer destroyed
  - sprite view destroyed
  - find new output for the sprite view
  - update colour profile for the sprite view
  - neither the view nor the compositor has any outputs left
  - try to use the stock sRGB transfer
  - oops, no colour manager

Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Daniel Stone 2025-04-29 10:24:48 +03:00 committed by Marius Vlad
parent 8ef3423bf7
commit 4393bec40a

View file

@ -1557,6 +1557,12 @@ weston_surface_assign_output(struct weston_surface *es)
uint32_t max, area, mask;
pixman_box32_t *e;
if (es->compositor->shutting_down) {
es->output = NULL;
es->output_mask = 0;
return;
}
new_output = NULL;
max = 0;
mask = 0;