diff --git a/src/win/conpty.cc b/src/win/conpty.cc index 3d7e9fd44..b4b33d10b 100644 --- a/src/win/conpty.cc +++ b/src/win/conpty.cc @@ -429,6 +429,9 @@ static Napi::Value PtyConnect(const Napi::CallbackInfo& info) { // Update handle handle->hShell = piClient.hProcess; + // Close the thread handle to avoid resource leak + CloseHandle(piClient.hThread); + SetupExitCallback(env, exitCallback, handle); // Return