Commit 148da222 authored by Pekka Pessi's avatar Pekka Pessi

nua: deinitializing dialogs with nua_dialog_deinit() when destroying handle.

darcs-hash:20060925205907-65a35-773f51a305a6d64c8835a07ac44b786c71c3c6e2.gz
parent d4cc8d3c
......@@ -404,7 +404,17 @@ void nua_dialog_log_usage(nua_owner_t *own, nua_dialog_state_t *ds)
}
}
/** @internal Dialog has been terminated. */
/** Deinitialize dialog and its usage. @internal */
void nua_dialog_deinit(nua_owner_t *own,
nua_dialog_state_t *ds)
{
while (ds->ds_usage) {
nua_dialog_usage_remove_at(own, ds, &ds->ds_usage);
}
}
/** @internal Dialog has been terminated. Remove all usages. */
void nua_dialog_terminated(nua_owner_t *own,
struct nua_dialog_state *ds,
int status,
......
......@@ -156,6 +156,9 @@ void nua_dialog_usage_remove(nua_owner_t *,
nua_dialog_state_t *ds,
nua_dialog_usage_t *du);
void nua_dialog_deinit(nua_owner_t *own,
nua_dialog_state_t *ds);
void nua_dialog_terminated(nua_owner_t *,
struct nua_dialog_state *ds,
int status,
......
......@@ -678,21 +678,20 @@ void nh_destroy(nua_t *nua, nua_handle_t *nh)
nea_server_destroy(nh->nh_notifier), nh->nh_notifier = NULL;
nua_creq_deinit(nh->nh_cr, NULL);
if (nh->nh_ss)
nua_creq_deinit(nh->nh_ss->ss_crequest, NULL);
if (nh->nh_ds->ds_leg) {
nta_leg_destroy(nh->nh_ds->ds_leg), nh->nh_ds->ds_leg = NULL;
}
if (nh->nh_ss->ss_srequest->sr_irq) {
nta_incoming_destroy(nh->nh_ss->ss_srequest->sr_irq);
nh->nh_ss->ss_srequest->sr_irq = NULL;
if (nh->nh_ss) {
nua_creq_deinit(nh->nh_ss->ss_crequest, NULL);
if (nh->nh_ss->ss_srequest->sr_irq) {
nta_incoming_destroy(nh->nh_ss->ss_srequest->sr_irq);
nh->nh_ss->ss_srequest->sr_irq = NULL;
}
}
if (nh->nh_soa)
soa_destroy(nh->nh_soa), nh->nh_soa = NULL;
nua_dialog_deinit(nh, nh->nh_ds);
if (nh_is_inserted(nh))
nh_remove(nua, nh);
......
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