diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-10-05 13:04:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-05 13:04:34 -0400 |
commit | 77eae178c725d13fee4862718af2a3029b128f41 (patch) | |
tree | a139bcebaa29e20ef3bf5dd971c1ebc8bc9fb2a7 | |
parent | edadbc7c7f88670afdbabd05a6027c438415c3db (diff) | |
parent | 134f708c55be1ce05bcf572dcef2f76da27be5c4 (diff) |
Merge pull request #207 from versusvoid/fix-double-free
Fix double free
-rw-r--r-- | types/wlr_seat.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/types/wlr_seat.c b/types/wlr_seat.c index 2d0bb01c..bb24fa15 100644 --- a/types/wlr_seat.c +++ b/types/wlr_seat.c @@ -262,6 +262,8 @@ static void pointer_surface_destroy_notify(struct wl_listener *listener, void *data) { struct wlr_seat_pointer_state *state = wl_container_of( listener, state, surface_destroy); + wl_list_remove(&state->surface_destroy.link); + wl_list_init(&state->surface_destroy.link); state->focused_surface = NULL; wlr_seat_pointer_clear_focus(state->wlr_seat); } @@ -270,6 +272,8 @@ static void pointer_resource_destroy_notify(struct wl_listener *listener, void *data) { struct wlr_seat_pointer_state *state = wl_container_of( listener, state, resource_destroy); + wl_list_remove(&state->resource_destroy.link); + wl_list_init(&state->resource_destroy.link); state->focused_surface = NULL; wlr_seat_pointer_clear_focus(state->wlr_seat); } @@ -499,6 +503,8 @@ static void keyboard_surface_destroy_notify(struct wl_listener *listener, void *data) { struct wlr_seat_keyboard_state *state = wl_container_of( listener, state, surface_destroy); + wl_list_remove(&state->surface_destroy.link); + wl_list_init(&state->surface_destroy.link); state->focused_surface = NULL; wlr_seat_keyboard_clear_focus(state->wlr_seat); } @@ -507,6 +513,8 @@ static void keyboard_resource_destroy_notify(struct wl_listener *listener, void *data) { struct wlr_seat_keyboard_state *state = wl_container_of( listener, state, resource_destroy); + wl_list_remove(&state->resource_destroy.link); + wl_list_init(&state->resource_destroy.link); state->focused_surface = NULL; wlr_seat_keyboard_clear_focus(state->wlr_seat); } |