diff options
Diffstat (limited to 'include/compat/pthread.h')
| -rw-r--r-- | include/compat/pthread.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/compat/pthread.h b/include/compat/pthread.h index 8211dda..7702dcd 100644 --- a/include/compat/pthread.h +++ b/include/compat/pthread.h | |||
| @@ -110,8 +110,11 @@ pthread_mutex_unlock(pthread_mutex_t *mutex) | |||
| 110 | static inline int | 110 | static inline int |
| 111 | pthread_mutex_destroy(pthread_mutex_t *mutex) | 111 | pthread_mutex_destroy(pthread_mutex_t *mutex) |
| 112 | { | 112 | { |
| 113 | DeleteCriticalSection(mutex->lock); | 113 | if (mutex->lock != NULL) { |
| 114 | free(mutex->lock); | 114 | DeleteCriticalSection(mutex->lock); |
| 115 | free(mutex->lock); | ||
| 116 | mutex->lock = NULL; | ||
| 117 | } | ||
| 115 | return 0; | 118 | return 0; |
| 116 | } | 119 | } |
| 117 | 120 | ||
