Skip to content

Commit 7fe4faa

Browse files
authored
Merge branch 'main' into add-argv0-support
2 parents 27d6d00 + d6ce76a commit 7fe4faa

File tree

3 files changed

+666
-30
lines changed

3 files changed

+666
-30
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"cross-env": "^5.1.4",
5454
"eslint": "^6.8.0",
5555
"mocha": "10",
56+
"node-gyp": "^9.4.0",
5657
"ps-list": "^6.0.0",
5758
"typescript": "^3.8.3"
5859
}

src/win/conpty.cc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,13 @@ static void OnProcessExit(uv_async_t *async) {
257257
DWORD exitCode = 0;
258258
GetExitCodeProcess(baton->hShell, &exitCode);
259259

260+
// Clean up handles
261+
// Calling DisconnectNamedPipes here or in PtyKill results in a crash,
262+
// ref https://github.com/microsoft/node-pty/issues/512,
263+
// so we only call CloseHandle for now.
264+
CloseHandle(baton->hIn);
265+
CloseHandle(baton->hOut);
266+
260267
// Call function
261268
v8::Local<v8::Value> args[1] = {
262269
Nan::New<v8::Number>(exitCode)
@@ -476,10 +483,6 @@ static NAN_METHOD(PtyKill) {
476483
}
477484
}
478485

479-
DisconnectNamedPipe(handle->hIn);
480-
DisconnectNamedPipe(handle->hOut);
481-
CloseHandle(handle->hIn);
482-
CloseHandle(handle->hOut);
483486
CloseHandle(handle->hShell);
484487
}
485488

0 commit comments

Comments
 (0)