From 41ec9dc4f16faf518dfe4155be49e516e6810bf1 Mon Sep 17 00:00:00 2001 From: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> Date: Fri, 25 Aug 2023 13:46:16 -0700 Subject: [PATCH] Tested the PR. Add comment --- src/win/conpty.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/win/conpty.cc b/src/win/conpty.cc index 7c5f0bfb6..f614cc4af 100644 --- a/src/win/conpty.cc +++ b/src/win/conpty.cc @@ -258,8 +258,9 @@ static void OnProcessExit(uv_async_t *async) { GetExitCodeProcess(baton->hShell, &exitCode); // Clean up handles - DisconnectNamedPipe(baton->hIn); - DisconnectNamedPipe(baton->hOut); + // Calling DisconnectNamedPipes here or in PtyKill results in a crash, + // ref https://github.com/microsoft/node-pty/issues/512, + // so we only call CloseHandle for now. CloseHandle(baton->hIn); CloseHandle(baton->hOut);