Skip to content
Snippets Groups Projects
Commit a6b16d70 authored by zuul's avatar zuul Committed by Gerrit Code Review
Browse files

Merge "res_pjsip_outbound_publish: Ensure publish is valid when explicitly destroying."

parents b0e4ea96 070eab6e
No related branches found
No related tags found
No related merge requests found
...@@ -1125,6 +1125,8 @@ static int explicit_publish_destroy(void *data) ...@@ -1125,6 +1125,8 @@ static int explicit_publish_destroy(void *data)
ao2_ref(publisher, -1); ao2_ref(publisher, -1);
} }
ao2_ref(publisher, -1);
return 0; return 0;
} }
...@@ -1140,7 +1142,9 @@ static int cancel_and_unpublish(void *obj, void *arg, int flags) ...@@ -1140,7 +1142,9 @@ static int cancel_and_unpublish(void *obj, void *arg, int flags)
/* If the publisher was never started, there's nothing to unpublish, so just /* If the publisher was never started, there's nothing to unpublish, so just
* destroy the publication and remove its reference to the publisher. * destroy the publication and remove its reference to the publisher.
*/ */
ast_sip_push_task(NULL, explicit_publish_destroy, publisher); if (ast_sip_push_task(NULL, explicit_publish_destroy, ao2_bump(publisher))) {
ao2_ref(publisher, -1);
}
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment