[mutter/wayland] wayland: Don't try to disconnect the listener from the signal handler



commit 0313b38dd623221a34ac62ee6d06ddffd88360cd
Author: Rui Matos <tiagomatos gmail com>
Date:   Fri Feb 28 18:16:01 2014 +0100

    wayland: Don't try to disconnect the listener from the signal handler
    
    This is not needed since the instance is being destroyed and in fact
    actively harmful when code called from other handlers disconnects us
    for other reasons. In that case we might crash because the
    disconnection doesn't prevent other handlers from running in the
    current signal emission and thus we try to remove ourselves from an
    empty list.

 src/wayland/meta-wayland-keyboard.c |    2 --
 src/wayland/meta-wayland-pointer.c  |    2 --
 src/wayland/meta-wayland-surface.c  |    1 -
 3 files changed, 0 insertions(+), 5 deletions(-)
---
diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c
index c357b77..477d563 100644
--- a/src/wayland/meta-wayland-keyboard.c
+++ b/src/wayland/meta-wayland-keyboard.c
@@ -222,7 +222,6 @@ keyboard_handle_focus_surface_destroy (struct wl_listener *listener, void *data)
 {
   MetaWaylandKeyboard *keyboard = wl_container_of (listener, keyboard, focus_surface_listener);
 
-  wl_list_remove (&keyboard->focus_surface_listener.link);
   keyboard->focus_surface = NULL;
 
   if (keyboard->focus_resource)
@@ -237,7 +236,6 @@ keyboard_handle_focus_resource_destroy (struct wl_listener *listener, void *data
 {
   MetaWaylandKeyboard *keyboard = wl_container_of (listener, keyboard, focus_resource_listener);
 
-  wl_list_remove (&keyboard->focus_resource_listener.link);
   keyboard->focus_resource = NULL;
 }
 
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index e0c9ad2..2692c85 100644
--- a/src/wayland/meta-wayland-pointer.c
+++ b/src/wayland/meta-wayland-pointer.c
@@ -59,7 +59,6 @@ pointer_handle_focus_surface_destroy (struct wl_listener *listener, void *data)
 {
   MetaWaylandPointer *pointer = wl_container_of (listener, pointer, focus_surface_listener);
 
-  wl_list_remove (&pointer->focus_surface_listener.link);
   pointer->focus_surface = NULL;
 
   if (pointer->focus_resource)
@@ -74,7 +73,6 @@ pointer_handle_focus_resource_destroy (struct wl_listener *listener, void *data)
 {
   MetaWaylandPointer *pointer = wl_container_of (listener, pointer, focus_resource_listener);
 
-  wl_list_remove (&pointer->focus_resource_listener.link);
   pointer->focus_resource = NULL;
 }
 
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index 3153939..ebf0c52 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -82,7 +82,6 @@ surface_handle_buffer_destroy (struct wl_listener *listener, void *data)
   wl_resource_post_error (surface->resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
                           "Destroyed buffer while it was attached to the surface");
   surface->buffer = NULL;
-  wl_list_remove (&surface->buffer_destroy_listener.link);
 }
 
 static void


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