From aecd3ec54ffacb766632fe53774a32d242b84aec Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Tue, 4 Dec 2012 15:58:11 +0200 Subject: [PATCH] compositor: do not flush shm buffer on destroy The protocol does not require us to flush_damage() on wl_buffer destruction. In fact, by the time the server receives this request, the client may have already clobbered the buffer's storage, so we could be reading undefined data. Instead, just forget about the buffer. The protocol already says, that a client must not destroy a buffer that is being read by the server, or the window contents become undefined. The practical reason for this change is that the following commit can consolidate wl_buffer destruction listener handlers. Signed-off-by: Pekka Paalanen --- src/compositor.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/compositor.c b/src/compositor.c index 88a37f7a..d80d929a 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -187,9 +187,6 @@ surface_handle_buffer_destroy(struct wl_listener *listener, void *data) container_of(listener, struct weston_surface, buffer_destroy_listener); - if (es->buffer && wl_buffer_is_shm(es->buffer)) - es->compositor->renderer->flush_damage(es); - es->buffer = NULL; }