seat: fix memory leak when explicitly destroying the seat

This commit is contained in:
Jente Hidskes 2019-02-21 11:35:43 +01:00
parent 2166fbdcfb
commit 707cb2cdfc
No known key found for this signature in database
GPG key ID: 04BE5A29F32D91EA

4
seat.c
View file

@ -652,6 +652,7 @@ handle_destroy(struct wl_listener *listener, void *data)
wl_list_remove(&seat->request_set_cursor.link);
wl_list_remove(&seat->request_set_selection.link);
wl_list_remove(&seat->request_set_primary_selection.link);
free(seat);
}
struct cg_seat *
@ -739,7 +740,8 @@ seat_destroy(struct cg_seat *seat)
return;
}
handle_destroy(&seat->destroy, NULL);
// Destroying the wlr seat will trigger the destroy handler on our seat,
// which will in turn free it.
wlr_seat_destroy(seat->seat);
}