Kill child process group (#621)

This commit is contained in:
Andrey Lushnikov 2017-08-30 14:16:03 -07:00 committed by JoelEinbinder
parent 223a1066bb
commit 66676c0235

View File

@ -78,7 +78,7 @@ class Launcher {
if (Array.isArray(options.args))
chromeArguments.push(...options.args);
const chromeProcess = childProcess.spawn(chromeExecutable, chromeArguments, {});
const chromeProcess = childProcess.spawn(chromeExecutable, chromeArguments, {detached: true});
if (options.dumpio) {
chromeProcess.stdout.pipe(process.stdout);
chromeProcess.stderr.pipe(process.stderr);
@ -107,7 +107,7 @@ class Launcher {
if (process.platform === 'win32')
childProcess.execSync(`taskkill /pid ${chromeProcess.pid} /T /F`);
else
chromeProcess.kill('SIGKILL');
process.kill(-chromeProcess.pid);
}
}