mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: remove killed check to allow multiple signals (#40667)
* fix: remove `killed` check to allow multiple signals * fix: signal forwarding
This commit is contained in:
@@ -5,11 +5,15 @@ const utils = require('./lib/utils');
|
||||
const electronPath = utils.getAbsoluteElectronExec();
|
||||
|
||||
const child = cp.spawn(electronPath, process.argv.slice(2), { stdio: 'inherit' });
|
||||
child.on('close', (code) => process.exit(code));
|
||||
let childClosed = false;
|
||||
child.on('close', (code) => {
|
||||
childClosed = true;
|
||||
process.exit(code);
|
||||
});
|
||||
|
||||
const handleTerminationSignal = (signal) =>
|
||||
process.on(signal, () => {
|
||||
if (!child.killed) {
|
||||
if (!childClosed) {
|
||||
child.kill(signal);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user