Skip to content

Commit

Permalink
Ensure "core" is destroyed when exit() is invoked
Browse files Browse the repository at this point in the history
  • Loading branch information
aedart committed Oct 27, 2024
1 parent eb18af2 commit 61a945d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/cli/src/CliApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,11 @@ export default class CliApplication
*/
public async run(argv?: readonly string[], options?: ParseOptions): Promise<boolean>
{
const callback = CallbackWrapper.makeFor(
return await this.core.run(CallbackWrapper.makeFor(
this,
this.parse,
[argv, options]
);

return await this.core.run(callback);
));
}

/**
Expand Down Expand Up @@ -228,6 +226,8 @@ export default class CliApplication
*/
protected exit(code: number = 0): void|never
{
this.core.destroy();

if (this.processExit) {
process.exit(code);
}
Expand Down

0 comments on commit 61a945d

Please sign in to comment.