[PATCH 07/10] compositor; Don't repaint outputs being destroyed
Ander Conselvan de Oliveira
conselvan2 at gmail.com
Fri Dec 13 12:10:55 PST 2013
From: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>
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.
---
src/compositor.c | 5 +++++
src/compositor.h | 1 +
2 files changed, 6 insertions(+)
diff --git a/src/compositor.c b/src/compositor.c
index e4eb56d..ed6548c 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1759,6 +1759,9 @@ weston_output_repaint(struct weston_output *output, uint32_t msecs)
pixman_region32_t output_damage;
int r;
+ if (output->destroying)
+ return 0;
+
/* Rebuild the surface list and update surface transforms up front. */
weston_compositor_build_view_list(ec);
@@ -3105,6 +3108,8 @@ weston_compositor_remove_output(struct weston_compositor *compositor,
WL_EXPORT void
weston_output_destroy(struct weston_output *output)
{
+ output->destroying = 1;
+
weston_compositor_remove_output(output->compositor, output);
wl_list_remove(&output->link);
diff --git a/src/compositor.h b/src/compositor.h
index 84b0f79..901366f 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -198,6 +198,7 @@ struct weston_output {
int move_x, move_y;
uint32_t frame_time;
int disable_planes;
+ int destroying;
char *make, *model, *serial_number;
uint32_t subpixel;
--
1.7.9.5
More information about the wayland-devel
mailing list