← Commit list

142d61a0ee

Daniel Stenberg
Daniel Stenberg
2025-10-12
SUCCESS Duration: 182s

Subject

doswin: CloseHandle the thread on shutdown

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

src/tool_doswin.c+3 -3
@@ -809,9 +809,6 @@ ThreadCleanup:
}
/* The background thread that reads and buffers the true stdin. */
-static HANDLE stdin_thread = NULL;
-static curl_socket_t socket_r = CURL_SOCKET_BAD;
-
curl_socket_t win32_stdin_read_thread(void)
{
int result;
@@ -819,6 +816,8 @@ curl_socket_t win32_stdin_read_thread(void)
int rc = 0, socksize = 0;
struct win_thread_data *tdata = NULL;
SOCKADDR_IN selfaddr;
+ static HANDLE stdin_thread = NULL;
+ static curl_socket_t socket_r = CURL_SOCKET_BAD;
if(socket_r != CURL_SOCKET_BAD) {
assert(stdin_thread != NULL);
@@ -930,6 +929,7 @@ curl_socket_t win32_stdin_read_thread(void)
if(stdin_thread) {
TerminateThread(stdin_thread, 1);
+ CloseHandle(stdin_thread);
stdin_thread = NULL;
}