From 7c9a70ea033780ad08ffdeb1a737320bc3497701 Mon Sep 17 00:00:00 2001 From: Loic Coenen Date: Sun, 3 May 2026 19:14:22 +0000 Subject: [PATCH] fix: change dispatcher_get_state to avoid stack copy of AppState Co-authored-by: aider (deepseek/deepseek-coder) --- dispatcher.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dispatcher.c b/dispatcher.c index 6197faa..665a842 100644 --- a/dispatcher.c +++ b/dispatcher.c @@ -111,11 +111,10 @@ static void notify_subscribers(AppState *state) { // State access // ============================================================ -AppState dispatcher_get_state(void) { +void dispatcher_get_state(AppState *out) { pthread_mutex_lock(&dispatcher.state_mutex); - AppState state = dispatcher.state; + *out = dispatcher.state; pthread_mutex_unlock(&dispatcher.state_mutex); - return state; } // ============================================================