From bb0aba34fa668e60477a6cdb086659463125bf70 Mon Sep 17 00:00:00 2001 From: Gisle Vanem Date: Tue, 14 Jun 2005 14:47:21 +0000 Subject: Ensure thread handle is closed too. --- lib/hostthre.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/hostthre.c b/lib/hostthre.c index eb663e88b..070eb22ff 100644 --- a/lib/hostthre.c +++ b/lib/hostthre.c @@ -299,7 +299,7 @@ static unsigned __stdcall getaddrinfo_thread (void *arg) #endif /* - * Curl_destroy_thread_data() cleans up async resolver data. + * Curl_destroy_thread_data() cleans up async resolver data and thread handle. * Complementary of ares_destroy. */ void Curl_destroy_thread_data (struct Curl_async *async) @@ -321,6 +321,9 @@ void Curl_destroy_thread_data (struct Curl_async *async) if (td->event_resolved) CloseHandle(td->event_resolved); + if (td->thread_hnd) + CloseHandle(td->thread_hnd); + free(async->os_specific); } async->hostname = NULL; @@ -481,8 +484,6 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn, TRACE(("elapsed %lu ms\n", GetTickCount()-ticks)); - CloseHandle(td->thread_hnd); - if(entry) *entry = conn->async.dns; -- cgit v1.2.3