mirror of
https://github.com/curl/curl.git
synced 2026-08-25 14:33:44 +03:00
tests/server/util.c: fix thread handle not being closed
Reviewed-by: Jay Satiro Part of #5260
This commit is contained in:
parent
fe28fcf04c
commit
551577f357
1 changed files with 9 additions and 2 deletions
|
|
@ -803,8 +803,15 @@ void restore_signal_handlers(bool keep_sigalrm)
|
|||
#ifdef WIN32
|
||||
(void)SetConsoleCtrlHandler(ctrl_event_handler, FALSE);
|
||||
if(thread_main_window && thread_main_id) {
|
||||
if(PostThreadMessage(thread_main_id, WM_APP, 0, 0))
|
||||
(void)WaitForSingleObjectEx(thread_main_window, INFINITE, TRUE);
|
||||
if(PostThreadMessage(thread_main_id, WM_APP, 0, 0)) {
|
||||
if(WaitForSingleObjectEx(thread_main_window, INFINITE, TRUE)) {
|
||||
if(CloseHandle(thread_main_window)) {
|
||||
thread_main_window = NULL;
|
||||
thread_main_id = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue