mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2024-11-27 11:54:44 +08:00
Merge pull request #1955 from nfedera/fix-2014-07-10-02
winpr: CloseHandle did not release the thread TCB
This commit is contained in:
commit
6b47229563
@ -139,6 +139,9 @@ BOOL CloseHandle(HANDLE hObject)
|
||||
WINPR_THREAD* thread;
|
||||
|
||||
thread = (WINPR_THREAD*) Object;
|
||||
if (thread->started) {
|
||||
pthread_detach(thread->thread);
|
||||
}
|
||||
free(thread);
|
||||
|
||||
return TRUE;
|
||||
|
@ -259,6 +259,8 @@ DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds)
|
||||
else
|
||||
status = pthread_join(thread->thread, &thread_status);
|
||||
|
||||
thread->started = FALSE;
|
||||
|
||||
if (status != 0)
|
||||
{
|
||||
fprintf(stderr, "WaitForSingleObject: pthread_join failure: [%d] %s\n",
|
||||
|
Loading…
Reference in New Issue
Block a user