backend/wayland: fix leak of some globals

Fix a few globals which weren't properly cleaned up. Discovered
in [1].

[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3604
This commit is contained in:
Simon Ser 2023-03-01 16:06:37 +01:00
parent cab47d33e2
commit 97c8ad7c65
1 changed files with 9 additions and 0 deletions

View File

@ -485,18 +485,27 @@ static void backend_destroy(struct wlr_backend *backend) {
destroy_wl_seat(seat);
}
if (wl->activation_v1) {
xdg_activation_v1_destroy(wl->activation_v1);
}
if (wl->zxdg_decoration_manager_v1) {
zxdg_decoration_manager_v1_destroy(wl->zxdg_decoration_manager_v1);
}
if (wl->zwp_pointer_gestures_v1) {
zwp_pointer_gestures_v1_destroy(wl->zwp_pointer_gestures_v1);
}
if (wl->tablet_manager) {
zwp_tablet_manager_v2_destroy(wl->tablet_manager);
}
if (wl->presentation) {
wp_presentation_destroy(wl->presentation);
}
if (wl->zwp_linux_dmabuf_v1) {
zwp_linux_dmabuf_v1_destroy(wl->zwp_linux_dmabuf_v1);
}
if (wl->legacy_drm != NULL) {
wl_drm_destroy(wl->legacy_drm);
}
if (wl->shm) {
wl_shm_destroy(wl->shm);
}