From 10df946671a12b4c0f4c13d4556a8bae6fc30394 Mon Sep 17 00:00:00 2001 From: Manuel Stoeckl Date: Sun, 6 Aug 2023 13:13:07 -0400 Subject: [PATCH] Fix Wayland object leaks when outputs are destroyed --- main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index fe018b5..d6eeae6 100644 --- a/main.c +++ b/main.c @@ -97,12 +97,18 @@ static void destroy_surface(struct swaylock_surface *surface) { if (surface->ext_session_lock_surface_v1 != NULL) { 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) { wl_surface_destroy(surface->surface); } destroy_buffer(&surface->indicator_buffers[0]); destroy_buffer(&surface->indicator_buffers[1]); - wl_output_destroy(surface->output); + wl_output_release(surface->output); free(surface); }