Merge "res_pjsip_pubsub: Prevent crashes on final NOTIFY."

This commit is contained in:
Matt Jordan 2015-10-25 10:13:03 -05:00 committed by Gerrit Code Review
commit d1441dfff7
1 changed files with 2 additions and 1 deletions

View File

@ -598,6 +598,7 @@ static void subscription_persistence_remove(struct sip_subscription_tree *sub_tr
ast_sorcery_delete(ast_sip_get_sorcery(), sub_tree->persistence);
ao2_ref(sub_tree->persistence, -1);
sub_tree->persistence = NULL;
}
@ -1185,7 +1186,6 @@ static void subscription_tree_destructor(void *obj)
remove_subscription(sub_tree);
subscription_persistence_remove(sub_tree);
ao2_cleanup(sub_tree->endpoint);
destroy_subscriptions(sub_tree->root);
@ -3289,6 +3289,7 @@ static void pubsub_on_evsub_state(pjsip_evsub *evsub, pjsip_event *event)
ast_sip_dialog_set_serializer(sub_tree->dlg, NULL);
ast_sip_dialog_set_endpoint(sub_tree->dlg, NULL);
sub_tree->dlg = NULL;
subscription_persistence_remove(sub_tree);
shutdown_subscriptions(sub_tree->root);
/* Remove evsub's reference to the sub_tree */