second try with atexit

This commit is contained in:
11soda11 2026-07-28 04:16:11 +02:00
parent 984d3bef52
commit 13f10b2fe0

View file

@ -730,7 +730,6 @@ static DWORD WINAPI win_stdin_thread_func(void *thread_data)
{
(void)thread_data;
atexit(cleanup_tdata);
for(;;) {
DWORD n;
@ -834,6 +833,12 @@ curl_socket_t win32_stdin_read_thread(void)
curl_socklen_t socksize = 0;
struct sockaddr_in selfaddr;
/* prevent mem leak warnings */
if(atexit(&cleanup_tdata)) {
errorf("atexit() error");
break;
}
/* Create the listening socket. It is used to create the writing socket by
* accepting a connection from the reading socket. */
socket_l = CURL_SOCKET(AF_INET, SOCK_STREAM, IPPROTO_TCP);