Skip to content

Commit

Permalink
fix(process): no send close event when process exit (#21)
Browse files Browse the repository at this point in the history
Signed-off-by: Black-Hole1 <[email protected]>
  • Loading branch information
BlackHole1 authored Dec 4, 2023
1 parent b221fd0 commit 55089d5
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/darwin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,9 @@ export class DarwinOVM {
cwd: this.options.targetDir,
});

this.gvproxyProcess.once("close", (_code, _signal) => {
if (!this.vfkitProcess?.killed) {
this.vfkitProcess?.kill();
}
this.gvproxyProcess.once("exit", (_code, _signal) => {
// eslint-disable-next-line @typescript-eslint/no-empty-function
this.stop().catch((_error) => {});
});

this.gvproxyProcess.stdout.on("data", (data) => {
Expand Down Expand Up @@ -253,10 +252,9 @@ export class DarwinOVM {
cwd: this.options.targetDir,
});

this.vfkitProcess.once("close", (_code, _signal) => {
if (!this.gvproxyProcess?.killed) {
this.gvproxyProcess?.kill();
}
this.vfkitProcess.once("exit", (_code, _signal) => {
// eslint-disable-next-line @typescript-eslint/no-empty-function
this.stop().catch((_error) => {});
});

this.vfkitProcess.stdout.on("data", (data) => {
Expand Down

0 comments on commit 55089d5

Please sign in to comment.