Index: /pjproject/trunk/pjmedia/include/pjmedia/conference.h
===================================================================
--- /pjproject/trunk/pjmedia/include/pjmedia/conference.h	(revision 2727)
+++ /pjproject/trunk/pjmedia/include/pjmedia/conference.h	(revision 2728)
@@ -239,4 +239,7 @@
 
 /**
+ * <i><b>Warning:</b> This API has been deprecated since 1.3 and will be
+ * removed in the future release, use #PJMEDIA_SPLITCOMB instead.</i>
+ *
  * Create and add a passive media port to the conference bridge. Unlike
  * "normal" media port that is added with #pjmedia_conf_add_port(), media
Index: /pjproject/trunk/pjmedia/src/pjmedia/conference.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/conference.c	(revision 2727)
+++ /pjproject/trunk/pjmedia/src/pjmedia/conference.c	(revision 2728)
@@ -572,11 +572,15 @@
     /* Create port zero for sound device. */
     status = create_sound_port(pool, conf);
-    if (status != PJ_SUCCESS)
+    if (status != PJ_SUCCESS) {
+	pjmedia_conf_destroy(conf);
 	return status;
+    }
 
     /* Create mutex. */
     status = pj_mutex_create_recursive(pool, "conf", &conf->mutex);
-    if (status != PJ_SUCCESS)
+    if (status != PJ_SUCCESS) {
+	pjmedia_conf_destroy(conf);
 	return status;
+    }
 
     /* If sound device was created, connect sound device to the
@@ -627,4 +631,6 @@
 PJ_DEF(pj_status_t) pjmedia_conf_destroy( pjmedia_conf *conf )
 {
+    unsigned i, ci;
+
     PJ_ASSERT_RETURN(conf != NULL, PJ_EINVAL);
 
@@ -635,6 +641,22 @@
     }
 
+    /* Destroy delay buf of all (passive) ports. */
+    for (i=0, ci=0; i<conf->max_ports && ci<conf->port_cnt; ++i) {
+	struct conf_port *cport;
+
+	cport = conf->ports[i];
+	if (!cport)
+	    continue;
+	
+	++ci;
+	if (cport->delay_buf) {
+	    pjmedia_delay_buf_destroy(cport->delay_buf);
+	    cport->delay_buf = NULL;
+	}
+    }
+
     /* Destroy mutex */
-    pj_mutex_destroy(conf->mutex);
+    if (conf->mutex)
+	pj_mutex_destroy(conf->mutex);
 
     return PJ_SUCCESS;
@@ -794,4 +816,7 @@
     pj_status_t status;
 
+    PJ_LOG(1, (THIS_FILE, "This API has been deprecated since 1.3 and will "
+			  "be removed in the future release!"));
+
     PJ_ASSERT_RETURN(conf && pool, PJ_EINVAL);
 
@@ -1122,4 +1147,12 @@
 	pj_assert(conf->connect_cnt > 0);
 	--conf->connect_cnt;
+    }
+
+    /* Destroy pjmedia port if this conf port is passive port,
+     * i.e: has delay buf.
+     */
+    if (conf_port->delay_buf) {
+	pjmedia_port_destroy(conf_port->port);
+	conf_port->port = NULL;
     }
 
Index: /pjproject/trunk/pjmedia/src/pjmedia/delaybuf.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/delaybuf.c	(revision 2727)
+++ /pjproject/trunk/pjmedia/src/pjmedia/delaybuf.c	(revision 2728)
@@ -122,15 +122,18 @@
     b->recalc_timer = RECALC_TIME;
 
-    status = pj_lock_create_recursive_mutex(pool, b->obj_name, 
-					    &b->lock);
-    if (status != PJ_SUCCESS)
-	return status;
-
+    /* Create circular buffer */
     status = pjmedia_circ_buf_create(pool, b->max_cnt, &b->circ_buf);
     if (status != PJ_SUCCESS)
 	return status;
 
+    /* Create WSOLA */
     status = pjmedia_wsola_create(pool, clock_rate, samples_per_frame, 1,
 				  0, &b->wsola);
+    if (status != PJ_SUCCESS)
+	return status;
+
+    /* Finally, create mutex */
+    status = pj_lock_create_recursive_mutex(pool, b->obj_name, 
+					    &b->lock);
     if (status != PJ_SUCCESS)
 	return status;
Index: /pjproject/trunk/pjmedia/src/pjmedia/echo_common.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/echo_common.c	(revision 2727)
+++ /pjproject/trunk/pjmedia/src/pjmedia/echo_common.c	(revision 2728)
@@ -240,4 +240,10 @@
 {
     (*echo->op->ec_destroy)(echo->state);
+
+    if (echo->delay_buf) {
+	pjmedia_delay_buf_destroy(echo->delay_buf);
+	echo->delay_buf = NULL;
+    }
+
     pj_pool_release(echo->pool);
     return PJ_SUCCESS;
