[mutter/wip/wayland] meta-wayland: unlink buffer destroy listener on free



commit bac7d2cccbb186f62229e7910599411521d2e8a8
Author: Robert Bragg <robert linux intel com>
Date:   Wed Jan 11 16:09:21 2012 +0000

    meta-wayland: unlink buffer destroy listener on free
    
    When freeing a MetaWaylandBuffer we need to make sure to unlink our
    destroy listener otherwise if the list is later iterated we can crash
    due to dereferencing an invalid ->func pointer.
    
    With this wayland clients no longer crash after rendering just a few
    frames.

 src/wayland/meta-wayland.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index f7104be..6e67a27 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -142,6 +142,8 @@ meta_wayland_buffer_free (MetaWaylandBuffer *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)
     {
       MetaWaylandSurface *surface = l->data;



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