From c8a74c0c2de9fb257b1273ff6fbbbf7eb4e6a6da Mon Sep 17 00:00:00 2001 From: Armin Preiml Date: Thu, 14 Aug 2025 18:43:36 +0200 Subject: check for pending callback on destroy_surface Avoids segfaults when a pending surface_frame_handle_done is invoked after destruction of the associated surface. This happened when an output was removed and the surfaces have been destroyed, between render and the surface_frame_handle_done. --- main.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'main.c') diff --git a/main.c b/main.c index cce8f4b..07e6667 100644 --- a/main.c +++ b/main.c @@ -92,6 +92,9 @@ static void daemonize(void) { } static void destroy_surface(struct swaylock_surface *surface) { + if (surface->frame != NULL) { + wl_callback_destroy(surface->frame); + } wl_list_remove(&surface->link); if (surface->ext_session_lock_surface_v1 != NULL) { ext_session_lock_surface_v1_destroy(surface->ext_session_lock_surface_v1); -- cgit v1.2.3