summaryrefslogtreecommitdiff
path: root/res/res_stasis_device_state.c
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2015-05-22 22:50:43 -0400
committerCorey Farrell <git@cfware.com>2015-05-22 22:58:32 -0400
commit0d266cbe025e30ce18121f43dbb6b11620b4d5e1 (patch)
tree3f215665d20602915427b42768fbcbdc1af47e67 /res/res_stasis_device_state.c
parenteaabc4d04c9c4ebca1a4d04b5e9e6a36cc0b764b (diff)
Stasis: Fix unsafe use of stasis_unsubscribe in modules.
Many uses of stasis_unsubscribe in modules can be reached through unload. These have been switched to stasis_unsubscribe_and_join. Some subscription callbacks do nothing, for these I've created a noop callback function in stasis.c. This is used by some modules that monitor MWI topics in order to enable cache, since the callback does not become invalid after dlclose it is safe to use stasis_unsubscribe on these, even during module unload. ASTERISK-25121 #close Change-Id: Ifc2549fbd8eef7d703c222978e8f452e2972189c
Diffstat (limited to 'res/res_stasis_device_state.c')
-rw-r--r--res/res_stasis_device_state.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_stasis_device_state.c b/res/res_stasis_device_state.c
index 8a1c23049..aec6a6eca 100644
--- a/res/res_stasis_device_state.c
+++ b/res/res_stasis_device_state.c
@@ -105,7 +105,7 @@ static int device_state_subscriptions_cmp(void *obj, void *arg, int flags)
static void device_state_subscription_destroy(void *obj)
{
struct device_state_subscription *sub = obj;
- sub->sub = stasis_unsubscribe(sub->sub);
+ sub->sub = stasis_unsubscribe_and_join(sub->sub);
ast_string_field_free_memory(sub);
}