From f93f7cdf2cfb6e998c08febf8920b42d08447319 Mon Sep 17 00:00:00 2001 From: Jabber Developer Date: Thu, 14 May 2026 03:52:20 +0000 Subject: [PATCH] fix(ai): unlock mutex before early return in error callback The mutex was not released when the aiwin pointer was invalid, leading to a potential deadlock in the AI thread. --- src/ai/ai_client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ai/ai_client.c b/src/ai/ai_client.c index 320cc98f..32761284 100644 --- a/src/ai/ai_client.c +++ b/src/ai/ai_client.c @@ -110,6 +110,7 @@ _aiwin_display_error(gpointer user_data, const gchar* error_msg) ProfAiWin* aiwin = _aiwin_validate(user_data); if (!aiwin) { log_warning("[AI-THREAD] Cannot display error: aiwin is invalid or window was closed (msg: %s)", error_msg); + pthread_mutex_unlock(&lock); return; } aiwin_display_error(aiwin, error_msg);