diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2014-02-23 09:59:42 -0500 |
---|---|---|
committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2014-02-23 10:00:31 -0500 |
commit | ff8c4b1bcf1ecb30282c3b6ebe2574a4a520265a (patch) | |
tree | ebb3bfdaa6c91bb8c7c0f55be50f7565a24d6603 /src/wayland | |
parent | 337c69e22322713b92b074ab5b4934bdf513c00f (diff) | |
download | mutter-ff8c4b1bcf1ecb30282c3b6ebe2574a4a520265a.tar.gz |
pointer/keyboard: Fix segfault once more
If the resource is destroyed before the surface, then we'll kill
ourselves. Why can I never seem to write these correctly...
Diffstat (limited to 'src/wayland')
-rw-r--r-- | src/wayland/meta-wayland-keyboard.c | 7 | ||||
-rw-r--r-- | src/wayland/meta-wayland-pointer.c | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c index 198996e2b..c357b77f1 100644 --- a/src/wayland/meta-wayland-keyboard.c +++ b/src/wayland/meta-wayland-keyboard.c @@ -225,8 +225,11 @@ keyboard_handle_focus_surface_destroy (struct wl_listener *listener, void *data) wl_list_remove (&keyboard->focus_surface_listener.link); keyboard->focus_surface = NULL; - wl_list_remove (&keyboard->focus_resource_listener.link); - keyboard->focus_resource = NULL; + if (keyboard->focus_resource) + { + wl_list_remove (&keyboard->focus_resource_listener.link); + keyboard->focus_resource = NULL; + } } static void diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c index e554cb6a2..21e41bb80 100644 --- a/src/wayland/meta-wayland-pointer.c +++ b/src/wayland/meta-wayland-pointer.c @@ -63,8 +63,11 @@ pointer_handle_focus_surface_destroy (struct wl_listener *listener, void *data) wl_list_remove (&pointer->focus_surface_listener.link); pointer->focus_surface = NULL; - wl_list_remove (&pointer->focus_resource_listener.link); - pointer->focus_resource = NULL; + if (pointer->focus_resource) + { + wl_list_remove (&pointer->focus_resource_listener.link); + pointer->focus_resource = NULL; + } } static void |