Skip to content

Commit

Permalink
store pipe process reference and term on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
rafapaezbas committed Oct 22, 2024
1 parent e531e7a commit 5cc22aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gui/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -1529,6 +1529,12 @@ class PearGUI extends ReadyResource {
}
pipe.write(data)
})

electron.app.once('will-quit', () => {
for (const pipe of this.pipes) {
pipe.sp.kill('SIGTERM')
}
})
}

async app () {
Expand Down
1 change: 1 addition & 0 deletions lib/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class Worker {
this.#unref()
})
const pipe = sp.stdio[3]
pipe.sp = sp
return pipe
}

Expand Down

0 comments on commit 5cc22aa

Please sign in to comment.