Fix leak caused by undestroyed pthread mutex
diff --git a/lib/private-libwebsockets.h b/lib/private-libwebsockets.h
index 53c753e..87dc30b 100644
--- a/lib/private-libwebsockets.h
+++ b/lib/private-libwebsockets.h
@@ -1616,6 +1616,13 @@
{
pthread_mutex_init(&pt->lock, NULL);
}
+
+static LWS_INLINE void
+lws_pt_mutex_destroy(struct lws_context_per_thread *pt)
+{
+ pthread_mutex_destroy(&pt->lock);
+}
+
static LWS_INLINE void
lws_pt_lock(struct lws_context_per_thread *pt)
{
@@ -1629,6 +1636,7 @@
}
#else
#define lws_pt_mutex_init(_a) (void)(_a)
+#define lws_pt_mutex_destroy(_a) (void)(_a)
#define lws_pt_lock(_a) (void)(_a)
#define lws_pt_unlock(_a) (void)(_a)
#endif