Skip to content
Snippets Groups Projects
Commit 7ea6c669 authored by Joshua Colp's avatar Joshua Colp Committed by Gerrit Code Review
Browse files

Merge "res_stasis_device_state: Unsubscribe should remove old subscriptions"

parents 3dff2711 4f4936fd
No related branches found
No related tags found
No related merge requests found
...@@ -106,7 +106,6 @@ static int device_state_subscriptions_cmp(void *obj, void *arg, int flags) ...@@ -106,7 +106,6 @@ static int device_state_subscriptions_cmp(void *obj, void *arg, int flags)
static void device_state_subscription_destroy(void *obj) static void device_state_subscription_destroy(void *obj)
{ {
struct device_state_subscription *sub = obj; struct device_state_subscription *sub = obj;
sub->sub = stasis_unsubscribe_and_join(sub->sub);
ast_string_field_free_memory(sub); ast_string_field_free_memory(sub);
} }
...@@ -152,6 +151,9 @@ static struct device_state_subscription *find_device_state_subscription( ...@@ -152,6 +151,9 @@ static struct device_state_subscription *find_device_state_subscription(
static void remove_device_state_subscription( static void remove_device_state_subscription(
struct device_state_subscription *sub) struct device_state_subscription *sub)
{ {
if (sub->sub) {
sub->sub = stasis_unsubscribe_and_join(sub->sub);
}
ao2_unlink_flags(device_state_subscriptions, sub, OBJ_NOLOCK); ao2_unlink_flags(device_state_subscriptions, sub, OBJ_NOLOCK);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment