fix: change dispatcher_get_state to avoid stack copy of AppState

Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-03 19:14:22 +00:00
parent 3a358dde0c
commit 7c9a70ea03

View File

@@ -111,11 +111,10 @@ static void notify_subscribers(AppState *state) {
// State access // State access
// ============================================================ // ============================================================
AppState dispatcher_get_state(void) { void dispatcher_get_state(AppState *out) {
pthread_mutex_lock(&dispatcher.state_mutex); pthread_mutex_lock(&dispatcher.state_mutex);
AppState state = dispatcher.state; *out = dispatcher.state;
pthread_mutex_unlock(&dispatcher.state_mutex); pthread_mutex_unlock(&dispatcher.state_mutex);
return state;
} }
// ============================================================ // ============================================================