[clutter/fosdem-2012] test-wayland-surface: Remove the destroy notify when buffer is freed



commit ee345118709c84df0a640222be1f188eb0cece90
Author: Neil Roberts <neil linux intel com>
Date:   Mon Jan 9 12:47:52 2012 +0000

    test-wayland-surface: Remove the destroy notify when buffer is freed
    
    When the buffer is freed we need to also remove it from the destroy
    listener list on the resource or it will crash when the resource is
    destroyed and it invokes a pointer from a random memory location.

 tests/interactive/test-wayland-surface.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/tests/interactive/test-wayland-surface.c b/tests/interactive/test-wayland-surface.c
index 0a9a7c6..0040d11 100644
--- a/tests/interactive/test-wayland-surface.c
+++ b/tests/interactive/test-wayland-surface.c
@@ -208,6 +208,8 @@ tws_buffer_free (TWSBuffer *buffer)
 
   buffer->wayland_buffer->user_data = NULL;
 
+  wl_list_remove (&buffer->buffer_destroy_listener.link);
+
   for (l = buffer->surfaces_attached_to; l; l = l->next)
     {
       TWSSurface *surface = l->data;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]