mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-28 00:36:22 +00:00
fix(ai): use atomic ai_provider_ref() in cmd_ai_switch
src/command/cmd_funcs:11118 used a plain non-atomic ref_count++ on ai_provider, which is a data race against concurrent ai_provider_unref() calls using g_atomic_int_dec_and_test. - Expose ai_provider_ref() in ai_client.h (was static) - Replace non-atomic ref_count++ with ai_provider_ref() in cmd_ai_switch"
This commit is contained in:
@@ -205,7 +205,7 @@ ai_provider_new(const gchar* name, const gchar* api_url, const gchar* org_id)
|
||||
return provider;
|
||||
}
|
||||
|
||||
static AIProvider*
|
||||
AIProvider*
|
||||
ai_provider_ref(AIProvider* provider)
|
||||
{
|
||||
if (provider) {
|
||||
|
||||
Reference in New Issue
Block a user