Stasis: Fix unsafe use of stasis_unsubscribe in modules.
[asterisk/asterisk.git] / channels / chan_skinny.c
index 47c7352..03da0e0 100644 (file)
@@ -8756,7 +8756,7 @@ static int unload_module(void)
                                skinny_unlocksub(sub);
                        }
                        if (l->mwi_event_sub) {
                                skinny_unlocksub(sub);
                        }
                        if (l->mwi_event_sub) {
-                               l->mwi_event_sub = stasis_unsubscribe(l->mwi_event_sub);
+                               l->mwi_event_sub = stasis_unsubscribe_and_join(l->mwi_event_sub);
                        }
                        ast_mutex_unlock(&l->lock);
                        unregister_exten(l);
                        }
                        ast_mutex_unlock(&l->lock);
                        unregister_exten(l);