wayland: use wl_*_release() instead of wl_*_destroy()

This lets the compositor free up internal state.
This commit is contained in:
Daniel Eklöf 2020-11-09 19:59:05 +01:00
parent 71e98d5b8f
commit 85220a5543
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -159,14 +159,14 @@ seat_destroy(struct seat *seat)
if (seat->primary_selection_device != NULL)
zwp_primary_selection_device_v1_destroy(seat->primary_selection_device);
if (seat->data_device != NULL)
wl_data_device_destroy(seat->data_device);
wl_data_device_release(seat->data_device);
if (seat->wl_keyboard != NULL)
wl_keyboard_destroy(seat->wl_keyboard);
wl_keyboard_release(seat->wl_keyboard);
if (seat->wl_pointer != NULL)
wl_pointer_destroy(seat->wl_pointer);
wl_pointer_release(seat->wl_pointer);
if (seat->wl_seat != NULL)
wl_seat_destroy(seat->wl_seat);
wl_seat_release(seat->wl_seat);
free(seat->clipboard.text);
free(seat->primary.text);
@ -893,7 +893,7 @@ monitor_destroy(struct monitor *mon)
if (mon->xdg != NULL)
zxdg_output_v1_destroy(mon->xdg);
if (mon->output != NULL)
wl_output_destroy(mon->output);
wl_output_release(mon->output);
free(mon->make);
free(mon->model);
free(mon->name);
@ -914,7 +914,7 @@ handle_global_remove(void *data, struct wl_registry *registry, uint32_t name)
if (mon->wl_name != name)
continue;
LOG_INFO("monitor unplugged: %s", mon->name);
LOG_INFO("monitor unplugged or disabled: %s", mon->name);
/*
* Update all terminals that are mapped here. On Sway 1.4,
@ -1162,8 +1162,10 @@ wayl_destroy(struct wayland *wayl)
wl_registry_destroy(wayl->registry);
if (wayl->fd != -1)
fdm_del_no_close(wayl->fdm, wayl->fd);
if (wayl->display != NULL)
if (wayl->display != NULL) {
wayl_flush(wayl);
wl_display_disconnect(wayl->display);
}
free(wayl);
}