Fixes webbrowser.js to avoid undefined callback call
This commit is contained in:
parent
339f8f0ac9
commit
98ab547140
@ -74,18 +74,14 @@ WebBrowser.prototype = {
|
||||
try {
|
||||
testUtils.removeDirSync(this.tmpDir);
|
||||
this.process = null;
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Unable to cleanup after the process: ' + e);
|
||||
try {
|
||||
if (this.process) {
|
||||
var pid = this.process.pid;
|
||||
if (process.platform === 'win32') {
|
||||
// kill does not really work on windows
|
||||
spawn('taskkill', ['-F', '-PID', pid]).on('exit', callback);
|
||||
} else {
|
||||
spawn('kill', ['-s', 'SIGKILL', pid]).on('exit', callback);
|
||||
}
|
||||
this.process.kill('SIGKILL');
|
||||
}
|
||||
} catch (e) {}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user