use destructor instead

This commit is contained in:
Xuan Son Nguyen 2026-06-23 22:57:20 +02:00
parent 5d67f69f59
commit a432e6f863
2 changed files with 4 additions and 6 deletions

View File

@ -35,6 +35,9 @@ struct cli_context {
bool has_video = false;
cli_context(const common_params & params) : params(params) {}
~cli_context() {
shutdown();
}
// connect to --server-base or spawn a local llama-server child;
// argc/argv are needed to forward the server-relevant args to the child

View File

@ -59,13 +59,8 @@ int llama_cli(int argc, char ** argv) {
cli_context ctx_cli(params);
if (!ctx_cli.init()) {
ctx_cli.shutdown();
return 1;
}
int ret = ctx_cli.run();
ctx_cli.shutdown();
return ret;
return ctx_cli.run();
}