Commit c0de240a authored by Pekka Pessi's avatar Pekka Pessi

Fixed handle leaks in nua_test.c.

Added delay before nua_shutdown() in order to ease debugging.

darcs-hash:20060427204406-65a35-f24a060badf2df9a78ba895629175a94ccb6d8e3.gz
parent 91a161c3
......@@ -336,7 +336,7 @@ void ep_callback(nua_event_t event,
if (ep->printer)
ep->printer(event, "", status, phrase, nua, ctx, ep, nh, call, sip, tags);
if (call == NULL) {
if (call == NULL && nh) {
for (call = ep->call; call; call = call->next) {
if (!call->nh)
break;
......@@ -357,6 +357,9 @@ void ep_callback(nua_event_t event,
ep->running = 0;
ep->last_event = event;
if (call == NULL && nh)
nua_handle_destroy(nh);
}
void a_callback(nua_event_t event,
......@@ -1233,7 +1236,7 @@ int test_stack_errors(struct context *ctx)
if (print_headings)
printf("TEST NUA-1.2.3: unregister without register\n");
TEST_1(a_call->nh = nua_handle(a->nua, a_call, SIPTAG_TO(b->to), TAG_END()));
TEST_1(a_call->nh = nua_handle(a->nua, a_call, SIPTAG_TO(a->to), TAG_END()));
UNREGISTER(a, a_call, a_call->nh, TAG_END());
......@@ -1979,6 +1982,7 @@ int test_unregister(struct context *ctx)
TEST_1(!sip->sip_contact);
TEST_1(!e->next);
free_events_in_list(ctx, c->events);
nua_handle_destroy(c->call->nh), c->call->nh = NULL;
if (c->reg->nh) {
UNREGISTER(c, NULL, c->reg->nh, TAG_END());
......@@ -5701,6 +5705,9 @@ int test_deinit(struct context *ctx)
struct call *call;
if (!ctx->threading)
su_root_step(ctx->root, 100);
if (ctx->a.nua) {
for (call = ctx->a.call; call; call = call->next)
nua_handle_destroy(call->nh), call->nh = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment