Skip to content

Commit 4f5500c

Browse files
authored
Remove close-handler for powershell child process
2 problems could arise in the close-event handler if powerShellStart() is called after powerShellRelease(): 1. the variable _psChild could be null if the close-event was fired after the null assignment but before the spawn() call returns. (in my tests when powerShellStart is called 1s after powerShellRelease). 2. the signal from the kill()-call could be delivered to the newly created powershell subprocess. (in my tests when powerShellStart is called directly after powerShellRelease). In my view, the close handler is not necessary.
1 parent 3a558b2 commit 4f5500c

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

lib/util.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,6 @@ function powerShellStart() {
401401
_psChild.on('error', function () {
402402
powerShellProceedResults(_psResult + _psError);
403403
});
404-
_psChild.on('close', function () {
405-
_psChild.kill();
406-
});
407404
}
408405
}
409406
}

0 commit comments

Comments
 (0)