MT#57118 Don't destroy a whole call, if only a branch is to be destroyed

Upon calling the `monologue_delete_iter()`,  we have to take into account
an amount of forked legs we have now entirely in the call.

If there's more than 1 forked leg, don't mark the whole call for a full destruction,
since other forks might be successful (and they are not in a scope of processing now).
Only destroy this branch and associated to it monologue(s).

Change-Id: I6fdb4ba33ae7582578d84d57d91f9536d932ca47
pull/1657/head
Donat Zenichev 3 years ago
parent b48ebebd59
commit 177b4111c2

@ -4276,6 +4276,7 @@ static unsigned int monologue_delete_iter(struct call_monologue *a, int delete_d
if (!call)
return 0;
unsigned int call_viabranches_count = g_hash_table_size(call->viabranches);
GList *associated = g_hash_table_get_values(a->associated_tags);
unsigned int ret = 0;
@ -4304,6 +4305,13 @@ static unsigned int monologue_delete_iter(struct call_monologue *a, int delete_d
ret |= 0x1;
}
/* Take into account an amount of forked legs we have now.
* If there's more than 1 forked leg, don't mark the call for a full destruction,
* since other forks might be successful. Only destroy this branch and associated to it monologue(s).
*/
if (call_viabranches_count > 1)
ret |= 0x1;
g_list_free(associated);
return ret;
}

Loading…
Cancel
Save