[PATCH] compositor: remove from the list according buffer type

Tiago Vignatti tiago.vignatti at intel.com
Mon Aug 1 07:36:52 PDT 2011


Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
---
this demonstrates that we shouldn't abuse from wl_list_remove feature of
removing elements in a empty list. It works, but we are touching things that we don't want.

 compositor/compositor.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/compositor/compositor.c b/compositor/compositor.c
index 177de54..f560255 100644
--- a/compositor/compositor.c
+++ b/compositor/compositor.c
@@ -360,7 +360,8 @@ destroy_surface(struct wl_resource *resource, struct wl_client *client)
 		compositor->destroy_image(compositor->display,
 					  surface->image);
 
-	wl_list_remove(&surface->buffer_link);
+	if (surface->buffer && wl_buffer_is_shm(surface->buffer))
+		wl_list_remove(&surface->buffer_link);
 
 	free(surface);
 }
-- 
1.7.2.2



More information about the wayland-devel mailing list