summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorArmin Preiml <apreiml@strohwolke.at>2025-08-14 18:43:36 +0200
committerSimon Ser <contact@emersion.fr>2025-08-16 16:22:15 +0200
commitc8a74c0c2de9fb257b1273ff6fbbbf7eb4e6a6da (patch)
tree79f2a7a2d9bf6dbdddfa56e16588ff1132cc7e18 /main.c
parentc48320819613e81a09e0481aaa2b92c93fba0d73 (diff)
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.
Diffstat (limited to 'main.c')
-rw-r--r--main.c3
1 files changed, 3 insertions, 0 deletions
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);