Instead of destroying all seats, destroy a single one. We only need to destroy all seats at one call-site (backend_destroy), but we'll need to destroy a single seat elsewhere in the next commit.
@ -469,7 +469,11 @@ static void backend_destroy(struct wlr_backend *backend) {
wlr_drm_format_set_finish(&wl->shm_formats);
wlr_drm_format_set_finish(&wl->linux_dmabuf_v1_formats);
destroy_wl_seats(wl);
struct wlr_wl_seat *seat, *tmp_seat;
wl_list_for_each_safe(seat, tmp_seat, &wl->seats, link) {
destroy_wl_seat(seat);
}
if (wl->zxdg_decoration_manager_v1) {
zxdg_decoration_manager_v1_destroy(wl->zxdg_decoration_manager_v1);
@ -246,9 +246,7 @@ bool create_wl_seat(struct wl_seat *wl_seat, struct wlr_wl_backend *wl) {
return true;
void destroy_wl_seats(struct wlr_wl_backend *wl) {
void destroy_wl_seat(struct wlr_wl_seat *seat) {
if (seat->wl_touch) {
wl_touch_release(seat->wl_touch);
wlr_touch_finish(&seat->wlr_touch);
@ -274,7 +272,6 @@ void destroy_wl_seats(struct wlr_wl_backend *wl) {
wl_list_remove(&seat->link);
free(seat);
bool wlr_input_device_is_wl(struct wlr_input_device *dev) {
switch (dev->type) {
@ -149,7 +149,7 @@ void init_seat_tablet(struct wlr_wl_seat *seat);
void finish_seat_tablet(struct wlr_wl_seat *seat);
bool create_wl_seat(struct wl_seat *wl_seat, struct wlr_wl_backend *wl);
void destroy_wl_seats(struct wlr_wl_backend *wl);
void destroy_wl_seat(struct wlr_wl_seat *seat);
void destroy_wl_buffer(struct wlr_wl_buffer *buffer);
extern const struct wlr_pointer_impl wl_pointer_impl;