Index: /pjproject/trunk/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c	(revision 4986)
+++ /pjproject/trunk/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c	(revision 4987)
@@ -881,5 +881,7 @@
 
     /* Destroy mutex. */
+    pj_mutex_unlock(ffmpeg_factory.mutex);
     pj_mutex_destroy(ffmpeg_factory.mutex);
+    ffmpeg_factory.mutex = NULL;
 
     /* Destroy pool. */
Index: /pjproject/trunk/pjmedia/src/pjmedia-codec/g7221.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia-codec/g7221.c	(revision 4986)
+++ /pjproject/trunk/pjmedia/src/pjmedia-codec/g7221.c	(revision 4987)
@@ -470,4 +470,5 @@
 	pj_pool_release(codec_factory.pool);
 	codec_factory.pool = NULL;
+	pj_mutex_unlock(codec_factory.mutex);
 	return PJ_EINVALIDOP;
     }
@@ -478,5 +479,7 @@
     
     /* Destroy mutex. */
+    pj_mutex_unlock(codec_factory.mutex);
     pj_mutex_destroy(codec_factory.mutex);
+    codec_factory.mutex = NULL;
 
     /* Destroy pool. */
Index: /pjproject/trunk/pjmedia/src/pjmedia-codec/ipp_codecs.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia-codec/ipp_codecs.c	(revision 4986)
+++ /pjproject/trunk/pjmedia/src/pjmedia-codec/ipp_codecs.c	(revision 4987)
@@ -767,4 +767,5 @@
 	pj_pool_release(ipp_factory.pool);
 	ipp_factory.pool = NULL;
+	pj_mutex_unlock(ipp_factory.mutex);
 	return PJ_EINVALIDOP;
     }
@@ -775,5 +776,7 @@
     
     /* Destroy mutex. */
+    pj_mutex_unlock(ipp_factory.mutex);
     pj_mutex_destroy(ipp_factory.mutex);
+    ipp_factory.mutex = NULL;
 
     /* Destroy pool. */
Index: /pjproject/trunk/pjmedia/src/pjmedia-codec/l16.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia-codec/l16.c	(revision 4986)
+++ /pjproject/trunk/pjmedia/src/pjmedia-codec/l16.c	(revision 4987)
@@ -230,4 +230,5 @@
 
     /* Destroy mutex. */
+    pj_mutex_unlock(l16_factory.mutex);
     pj_mutex_destroy(l16_factory.mutex);
     l16_factory.mutex = NULL;
Index: /pjproject/trunk/pjmedia/src/pjmedia-codec/passthrough.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia-codec/passthrough.c	(revision 4986)
+++ /pjproject/trunk/pjmedia/src/pjmedia-codec/passthrough.c	(revision 4987)
@@ -448,4 +448,5 @@
 	pj_pool_release(codec_factory.pool);
 	codec_factory.pool = NULL;
+	pj_mutex_unlock(codec_factory.mutex);
 	return PJ_EINVALIDOP;
     }
@@ -456,5 +457,7 @@
     
     /* Destroy mutex. */
+    pj_mutex_unlock(codec_factory.mutex);
     pj_mutex_destroy(codec_factory.mutex);
+    codec_factory.mutex = NULL;
 
     /* Destroy pool. */
Index: /pjproject/trunk/pjmedia/src/pjmedia-codec/silk.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia-codec/silk.c	(revision 4986)
+++ /pjproject/trunk/pjmedia/src/pjmedia-codec/silk.c	(revision 4987)
@@ -367,4 +367,5 @@
 
     /* Destroy mutex. */
+    pj_mutex_unlock(silk_factory.mutex);
     pj_mutex_destroy(silk_factory.mutex);
     silk_factory.mutex = NULL;
Index: /pjproject/trunk/pjmedia/src/pjmedia-codec/speex_codec.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia-codec/speex_codec.c	(revision 4986)
+++ /pjproject/trunk/pjmedia/src/pjmedia-codec/speex_codec.c	(revision 4987)
@@ -388,5 +388,7 @@
     
     /* Destroy mutex. */
+    pj_mutex_unlock(spx_factory.mutex);
     pj_mutex_destroy(spx_factory.mutex);
+    spx_factory.mutex = NULL;
 
     /* Destroy pool. */
Index: /pjproject/trunk/pjmedia/src/pjmedia/g711.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/g711.c	(revision 4986)
+++ /pjproject/trunk/pjmedia/src/pjmedia/g711.c	(revision 4987)
@@ -222,4 +222,5 @@
 
     /* Destroy mutex. */
+    pj_mutex_unlock(g711_factory.mutex);
     pj_mutex_destroy(g711_factory.mutex);
     g711_factory.mutex = NULL;
Index: /pjproject/trunk/pjnath/src/pjturn-srv/allocation.c
===================================================================
--- /pjproject/trunk/pjnath/src/pjturn-srv/allocation.c	(revision 4986)
+++ /pjproject/trunk/pjnath/src/pjturn-srv/allocation.c	(revision 4987)
@@ -1283,5 +1283,5 @@
 
 	/* Register to hash table */
-	pj_assert(sizeof(p2->channel==2));
+	pj_assert(sizeof(p2->channel)==2);
 	pj_hash_set(alloc->pool, alloc->ch_table, &p2->channel,
 		    sizeof(p2->channel), 0, p2);
