[mutter/wayland] pointer/keyboard: Make sure to clean up the destroy listeners when releasing



commit 4c621cc30fe62d4ca161c6ee540bade6cf1332fc
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Feb 18 18:39:05 2014 -0500

    pointer/keyboard: Make sure to clean up the destroy listeners when releasing

 src/wayland/meta-wayland-keyboard.c |    3 +++
 src/wayland/meta-wayland-pointer.c  |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c
index 2159cce..1a02f45 100644
--- a/src/wayland/meta-wayland-keyboard.c
+++ b/src/wayland/meta-wayland-keyboard.c
@@ -228,6 +228,9 @@ err_keymap_str:
 static void
 release_focus (MetaWaylandKeyboard *keyboard)
 {
+  wl_list_remove (&keyboard->focus_surface_listener.link);
+  wl_list_remove (&keyboard->focus_resource_listener.link);
+
   keyboard->focus_resource = NULL;
   keyboard->focus_surface = NULL;
 }
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index d01507f..30a1e9e 100644
--- a/src/wayland/meta-wayland-pointer.c
+++ b/src/wayland/meta-wayland-pointer.c
@@ -66,6 +66,9 @@ meta_wayland_pointer_get_seat (MetaWaylandPointer *pointer)
 static void
 release_focus (MetaWaylandPointer *pointer)
 {
+  wl_list_remove (&pointer->focus_surface_listener.link);
+  wl_list_remove (&pointer->focus_resource_listener.link);
+
   pointer->focus_resource = NULL;
   pointer->focus_surface = NULL;
 }


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