su_alloc.c: prevent mutex handle leak in WIN32

parent b75d20ff
......@@ -1019,8 +1019,15 @@ void _su_home_deinit(su_home_t *home)
home->suh_blocks = NULL;
if (home->suh_lock)
if (home->suh_lock) {
#ifdef WIN32
UNLOCK(home); /* we must unlock here or windows leaks handles on the next call because the mutex is locked */
/* "In the LinuxThreads implementation, no resources are associated with mutex objects,
thus pthread_mutex_destroy actually does nothing except checking that the mutex is unlocked. "
In the Windows pthread implementation we must free the handles that are allocated */
home->suh_lock = NULL;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment