compositor: Don't repaint outputs being destroyed

Set a flag when an output is being destroyed and use that to avoid
repainting. This allows functions that schedule an output repaint to
be called when the output is being destroyed without causing the
compositor to crash.
dev
Ander Conselvan de Oliveira 11 years ago committed by Kristian Høgsberg
parent 010d0b1695
commit e1e2352dcc
  1. 5
      src/compositor.c
  2. 1
      src/compositor.h

@ -1759,6 +1759,9 @@ weston_output_repaint(struct weston_output *output, uint32_t msecs)
pixman_region32_t output_damage; pixman_region32_t output_damage;
int r; int r;
if (output->destroying)
return 0;
/* Rebuild the surface list and update surface transforms up front. */ /* Rebuild the surface list and update surface transforms up front. */
weston_compositor_build_view_list(ec); weston_compositor_build_view_list(ec);
@ -3105,6 +3108,8 @@ weston_compositor_remove_output(struct weston_compositor *compositor,
WL_EXPORT void WL_EXPORT void
weston_output_destroy(struct weston_output *output) weston_output_destroy(struct weston_output *output)
{ {
output->destroying = 1;
weston_compositor_remove_output(output->compositor, output); weston_compositor_remove_output(output->compositor, output);
wl_list_remove(&output->link); wl_list_remove(&output->link);

@ -198,6 +198,7 @@ struct weston_output {
int move_x, move_y; int move_x, move_y;
uint32_t frame_time; uint32_t frame_time;
int disable_planes; int disable_planes;
int destroying;
char *make, *model, *serial_number; char *make, *model, *serial_number;
uint32_t subpixel; uint32_t subpixel;

Loading…
Cancel
Save