mirror of https://github.com/FreeRDP/FreeRDP
Ensuring mutex is unlocked on destroy.
This commit is contained in:
parent
ac15ce2da8
commit
fe27913859
|
@ -67,9 +67,9 @@ BOOL MutexCloseHandle(HANDLE handle)
|
||||||
if (!MutexIsHandled(handle))
|
if (!MutexIsHandled(handle))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
#if defined(WITH_DEBUG_MUTEX)
|
|
||||||
if (pthread_mutex_trylock(&mutex->mutex))
|
if (pthread_mutex_trylock(&mutex->mutex))
|
||||||
{
|
{
|
||||||
|
#if defined(WITH_DEBUG_MUTEX)
|
||||||
size_t used = 0, i;
|
size_t used = 0, i;
|
||||||
void* stack = winpr_backtrace(20);
|
void* stack = winpr_backtrace(20);
|
||||||
char **msg = NULL;
|
char **msg = NULL;
|
||||||
|
@ -84,10 +84,11 @@ BOOL MutexCloseHandle(HANDLE handle)
|
||||||
}
|
}
|
||||||
free (msg);
|
free (msg);
|
||||||
winpr_backtrace_free(stack);
|
winpr_backtrace_free(stack);
|
||||||
}
|
|
||||||
else
|
|
||||||
pthread_mutex_unlock(&mutex->mutex);
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pthread_mutex_unlock(&mutex->mutex))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
if (!pthread_mutex_destroy(&mutex->mutex))
|
if (!pthread_mutex_destroy(&mutex->mutex))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
Loading…
Reference in New Issue