mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -05:00
Close all thread handles returned from CreateThread.
If you don't, they are permanently leaked. A user points out that this is particularly bad in Pageant, with the new named-pipe-based IPC, since it will spawn an input and output I/O thread per named pipe connection, leading to two handles being leaked every time.
This commit is contained in:
@ -5355,8 +5355,10 @@ static void wintw_clip_request_paste(TermWin *tw, int clipboard)
|
||||
* that tells us it's OK to paste.
|
||||
*/
|
||||
DWORD in_threadid; /* required for Win9x */
|
||||
CreateThread(NULL, 0, clipboard_read_threadfunc,
|
||||
wgs.term_hwnd, 0, &in_threadid);
|
||||
HANDLE hThread = CreateThread(NULL, 0, clipboard_read_threadfunc,
|
||||
wgs.term_hwnd, 0, &in_threadid);
|
||||
if (hThread)
|
||||
CloseHandle(hThread); /* we don't need the thread handle */
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user