From c9cab416205ac406bc8cd278e9c0e1b79a6ba12a Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 14 Jul 2011 00:12:53 -0500 Subject: [PATCH] tweak debug code --- libs/sofia-sip/.update | 2 +- libs/sofia-sip/libsofia-sip-ua/nua/nua_common.c | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index 9544ad8244..83502caf5f 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Mon Jul 11 17:37:21 CDT 2011 +Wed Jul 6 15:11:41 CDT 2011 diff --git a/libs/sofia-sip/libsofia-sip-ua/nua/nua_common.c b/libs/sofia-sip/libsofia-sip-ua/nua/nua_common.c index 48988259b0..c3ee92d12f 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nua/nua_common.c +++ b/libs/sofia-sip/libsofia-sip-ua/nua/nua_common.c @@ -109,8 +109,8 @@ nua_handle_t *nh_create_handle(nua_t *nua, assert(nua->nua_home); - //if ((nh = su_home_clone(nua->nua_home, sizeof(*nh)))) { - if ((nh = su_home_clone(NULL, sizeof(*nh)))) { + if ((nh = su_home_clone(nua->nua_home, sizeof(*nh)))) { + //if ((nh = su_home_new(sizeof(*nh)))) { nh->nh_valid = nua_valid_handle_cookie; nh->nh_nua = nua; nh->nh_magic = hmagic; @@ -174,7 +174,7 @@ _nua_handle_ref_by(nua_handle_t *nh, { if (nh) SU_DEBUG_0(("%p - nua_handle_ref() => "MOD_ZU" by %s:%u: %s()\n", - nh, su_home_refcount((su_home_t *)nh) + 1, file, line, by)); + nh, su_home_refcount((su_home_t *)nh) + 1, file, line, function)); return (nua_handle_t *)su_home_ref((su_home_t *)nh); } @@ -186,15 +186,17 @@ _nua_handle_unref_by(nua_handle_t *nh, if (nh) { size_t refcount = su_home_refcount((su_home_t *)nh) - 1; int freed = su_home_unref((su_home_t *)nh); + if (freed) refcount = 0; SU_DEBUG_0(("%p - nua_handle_unref() => "MOD_ZU" by %s:%u: %s()\n", - nh, refcount, file, line, by)); + nh, refcount, file, line, function)); return freed; } return 0; } +#if 0 nua_handle_t *nua_handle_ref(nua_handle_t *nh) { return _nua_handle_ref_by(nh, "", 0, "") @@ -204,6 +206,7 @@ int nua_handle_unref(nua_handle_t *nh) { return _nua_handle_unref_by(nh, "", 0, "") } +#endif #else