From ada355e42912e3ecb7aef7ed1704af57998f3b2a Mon Sep 17 00:00:00 2001 From: Amit Mendapara <282290+cristatus@users.noreply.github.com> Date: Wed, 12 Aug 2026 07:09:28 +0530 Subject: [PATCH] [client] app: free the frame event after display server teardown Display server and overlay teardown can still call app_invalidateWindow, which signals the frame event; the Wayland presentation module does so when it unregisters its graph. Freeing the event beforehand asserted in lgSignalEvent while closing the client. --- client/src/main.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/client/src/main.c b/client/src/main.c index 6bac5a3d..b223fa63 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -3557,12 +3557,6 @@ static void lg_shutdown(void) lgAudio_free(); lgClipboard_setLocalAvailable(false); - if (g_state.frameEvent) - { - lgFreeEvent(g_state.frameEvent); - g_state.frameEvent = NULL; - } - if (e_startup) { lgFreeEvent(e_startup); @@ -3587,6 +3581,13 @@ static void lg_shutdown(void) g_state.overlays = NULL; } + // app_invalidateWindow runs during display server and overlay teardown + if (g_state.frameEvent) + { + lgFreeEvent(g_state.frameEvent); + g_state.frameEvent = NULL; + } + renderQueue_setSourceFns(NULL, NULL, NULL, NULL); renderQueue_free(); LG_LOCK_FREE(g_state.videoSourceLock);