提交 c9cab416 authored 作者: Anthony Minessale's avatar Anthony Minessale

tweak debug code

上级 e339b549
Mon Jul 11 17:37:21 CDT 2011 Wed Jul 6 15:11:41 CDT 2011
...@@ -109,8 +109,8 @@ nua_handle_t *nh_create_handle(nua_t *nua, ...@@ -109,8 +109,8 @@ nua_handle_t *nh_create_handle(nua_t *nua,
assert(nua->nua_home); assert(nua->nua_home);
//if ((nh = su_home_clone(nua->nua_home, sizeof(*nh)))) { if ((nh = su_home_clone(nua->nua_home, sizeof(*nh)))) {
if ((nh = su_home_clone(NULL, sizeof(*nh)))) { //if ((nh = su_home_new(sizeof(*nh)))) {
nh->nh_valid = nua_valid_handle_cookie; nh->nh_valid = nua_valid_handle_cookie;
nh->nh_nua = nua; nh->nh_nua = nua;
nh->nh_magic = hmagic; nh->nh_magic = hmagic;
...@@ -174,7 +174,7 @@ _nua_handle_ref_by(nua_handle_t *nh, ...@@ -174,7 +174,7 @@ _nua_handle_ref_by(nua_handle_t *nh,
{ {
if (nh) if (nh)
SU_DEBUG_0(("%p - nua_handle_ref() => "MOD_ZU" by %s:%u: %s()\n", 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); return (nua_handle_t *)su_home_ref((su_home_t *)nh);
} }
...@@ -186,15 +186,17 @@ _nua_handle_unref_by(nua_handle_t *nh, ...@@ -186,15 +186,17 @@ _nua_handle_unref_by(nua_handle_t *nh,
if (nh) { if (nh) {
size_t refcount = su_home_refcount((su_home_t *)nh) - 1; size_t refcount = su_home_refcount((su_home_t *)nh) - 1;
int freed = su_home_unref((su_home_t *)nh); int freed = su_home_unref((su_home_t *)nh);
if (freed) refcount = 0; if (freed) refcount = 0;
SU_DEBUG_0(("%p - nua_handle_unref() => "MOD_ZU" by %s:%u: %s()\n", 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 freed;
} }
return 0; return 0;
} }
#if 0
nua_handle_t *nua_handle_ref(nua_handle_t *nh) nua_handle_t *nua_handle_ref(nua_handle_t *nh)
{ {
return _nua_handle_ref_by(nh, "<app>", 0, "<app>") return _nua_handle_ref_by(nh, "<app>", 0, "<app>")
...@@ -204,6 +206,7 @@ int nua_handle_unref(nua_handle_t *nh) ...@@ -204,6 +206,7 @@ int nua_handle_unref(nua_handle_t *nh)
{ {
return _nua_handle_unref_by(nh, "<app>", 0, "<app>") return _nua_handle_unref_by(nh, "<app>", 0, "<app>")
} }
#endif
#else #else
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论