Skip to content

Commit 61a945d

Browse files
committed
Ensure "core" is destroyed when exit() is invoked
1 parent eb18af2 commit 61a945d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/cli/src/CliApplication.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,11 @@ export default class CliApplication
149149
*/
150150
public async run(argv?: readonly string[], options?: ParseOptions): Promise<boolean>
151151
{
152-
const callback = CallbackWrapper.makeFor(
152+
return await this.core.run(CallbackWrapper.makeFor(
153153
this,
154154
this.parse,
155155
[argv, options]
156-
);
157-
158-
return await this.core.run(callback);
156+
));
159157
}
160158

161159
/**
@@ -228,6 +226,8 @@ export default class CliApplication
228226
*/
229227
protected exit(code: number = 0): void|never
230228
{
229+
this.core.destroy();
230+
231231
if (this.processExit) {
232232
process.exit(code);
233233
}

0 commit comments

Comments
 (0)