fix(ai): unlock mutex before early return in error callback
Some checks failed
CI Code / Check coding style (pull_request) Successful in 36s
CI Code / Check spelling (pull_request) Successful in 20s
CI Code / Code Coverage (pull_request) Failing after 1m9s
CI Code / Linux (debian) (pull_request) Failing after 2m45s
CI Code / Linux (arch) (pull_request) Failing after 3m32s
CI Code / Linux (ubuntu) (pull_request) Failing after 2m53s

The mutex was not released when the aiwin pointer was invalid, leading to a potential deadlock in the AI thread.
This commit is contained in:
2026-05-14 03:52:20 +00:00
parent a9f0153c0f
commit f93f7cdf2c

View File

@@ -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);