summaryrefslogtreecommitdiff
path: root/res/res_pjsip_mwi.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:30:22 -0500
commit50044fdc15197b3a4a742827c97fc25daddc98aa (patch)
tree562e2b031fecf6cd7c5830410fd0eee0fed9a322 /res/res_pjsip_mwi.c
parentf66c41e668429b9a07dfdf30832c02ddc223f4a4 (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_pjsip_mwi.c')
-rw-r--r--res/res_pjsip_mwi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_pjsip_mwi.c b/res/res_pjsip_mwi.c
index 8fefc3ae0..371f3abf8 100644
--- a/res/res_pjsip_mwi.c
+++ b/res/res_pjsip_mwi.c
@@ -471,7 +471,7 @@ static int unsubscribe_stasis(void *obj, void *arg, int flags)
struct mwi_stasis_subscription *mwi_stasis = obj;
if (mwi_stasis->stasis_sub) {
ast_debug(3, "Removing stasis subscription to mailbox %s\n", mwi_stasis->mailbox);
- mwi_stasis->stasis_sub = stasis_unsubscribe(mwi_stasis->stasis_sub);
+ mwi_stasis->stasis_sub = stasis_unsubscribe_and_join(mwi_stasis->stasis_sub);
}
return CMP_MATCH;
}