tests(ai_client): remove remaining ai_provider_unref() before ai_client_shutdown()
All checks were successful
CI Code / Check spelling (pull_request) Successful in 28s
CI Code / Check coding style (pull_request) Successful in 36s
CI Code / Linux (arch) (pull_request) Successful in 5m47s
CI Code / Code Coverage (pull_request) Successful in 2m41s
CI Code / Linux (debian) (pull_request) Successful in 4m38s
CI Code / Linux (ubuntu) (pull_request) Successful in 4m42s

Fix three more tests that called ai_provider_unref() on providers owned
by the hash table, causing use-after-free when ai_client_shutdown()
destroyed the hash table.

Tests fixed:
- test_ai_parse_models_null_handling
- test_ai_parse_models_escaped_quotes
- test_ai_parse_models_with_whitespace
This commit is contained in:
2026-05-15 01:57:35 +00:00
parent 91695c0d4d
commit 01b695dd70

View File

@@ -834,7 +834,6 @@ test_ai_parse_models_null_handling(void** state)
ai_parse_models_from_json(provider, NULL);
assert_null(provider->models);
ai_provider_unref(provider);
ai_client_shutdown();
}
@@ -858,7 +857,6 @@ test_ai_parse_models_escaped_quotes(void** state)
GList* models = provider->models;
assert_non_null(models);
ai_provider_unref(provider);
ai_client_shutdown();
}
@@ -882,7 +880,6 @@ test_ai_parse_models_with_whitespace(void** state)
GList* models = provider->models;
assert_string_equal("model-with-spaces", models->data);
ai_provider_unref(provider);
ai_client_shutdown();
}