LP#1268619: websocket : mutex cleanup
authorBill Erickson <berick@esilibrary.com>
Wed, 5 Dec 2012 21:52:06 +0000 (16:52 -0500)
committerBill Erickson <berick@esilibrary.com>
Sun, 4 May 2014 20:10:34 +0000 (16:10 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
src/gateway/osrf_websocket_translator.c

index 4ce4db2..fa54821 100644 (file)
@@ -72,7 +72,7 @@
 typedef struct _osrfWebsocketTranslator {
     const WebSocketServer *server;
     apr_pool_t *main_pool; // standalone per-process pool
-    apr_pool_t *session_pool; // child of trans->main_pool; per-session
+    apr_pool_t *session_pool; // child of r->pool; per-session
     apr_hash_t *session_cache; 
     apr_thread_t *responder_thread;
     apr_thread_mutex_t *mutex;
@@ -565,6 +565,7 @@ void CALLBACK on_disconnect_handler(
 void CALLBACK on_destroy_handler(WebSocketPlugin *plugin) {
     if (trans) {
         apr_thread_exit(trans->responder_thread, APR_SUCCESS);
+        apr_thread_mutex_destroy(trans->mutex);
         apr_pool_destroy(trans->main_pool);
     }