Fix Wayland object leaks when outputs are destroyed

This commit is contained in:
Manuel Stoeckl 2023-08-06 13:13:07 -04:00 committed by Simon Ser
parent 2018673e1d
commit 10df946671

8
main.c
View File

@ -97,12 +97,18 @@ static void destroy_surface(struct swaylock_surface *surface) {
if (surface->ext_session_lock_surface_v1 != NULL) { if (surface->ext_session_lock_surface_v1 != NULL) {
ext_session_lock_surface_v1_destroy(surface->ext_session_lock_surface_v1); ext_session_lock_surface_v1_destroy(surface->ext_session_lock_surface_v1);
} }
if (surface->subsurface) {
wl_subsurface_destroy(surface->subsurface);
}
if (surface->child) {
wl_surface_destroy(surface->child);
}
if (surface->surface != NULL) { if (surface->surface != NULL) {
wl_surface_destroy(surface->surface); wl_surface_destroy(surface->surface);
} }
destroy_buffer(&surface->indicator_buffers[0]); destroy_buffer(&surface->indicator_buffers[0]);
destroy_buffer(&surface->indicator_buffers[1]); destroy_buffer(&surface->indicator_buffers[1]);
wl_output_destroy(surface->output); wl_output_release(surface->output);
free(surface); free(surface);
} }