struct stasis_caching_topic *stasis_caching_unsubscribe_and_join(struct stasis_caching_topic *caching_topic) { if (!caching_topic) { return NULL; } /* Hold a ref past the unsubscribe */ ao2_ref(caching_topic, +1); stasis_caching_unsubscribe(caching_topic); stasis_subscription_join(caching_topic->sub); ao2_cleanup(caching_topic); return NULL; }
struct stasis_subscription *stasis_unsubscribe_and_join( struct stasis_subscription *subscription) { if (!subscription) { return NULL; } /* Bump refcount to hold it past the unsubscribe */ ao2_ref(subscription, +1); stasis_unsubscribe(subscription); stasis_subscription_join(subscription); /* Now decrement the refcount back */ ao2_cleanup(subscription); return NULL; }