Skip to content

Commit d2bf81f

Browse files
committed
Close piClient.hThread handle
Fixes microsoft#717
1 parent 796e11e commit d2bf81f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/win/conpty.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,9 @@ static Napi::Value PtyConnect(const Napi::CallbackInfo& info) {
429429
// Update handle
430430
handle->hShell = piClient.hProcess;
431431

432+
// Close the thread handle to avoid resource leak
433+
CloseHandle(piClient.hThread);
434+
432435
SetupExitCallback(env, exitCallback, handle);
433436

434437
// Return

0 commit comments

Comments
 (0)