Fix destruction order assert for stasis_bridging
authorDavid M. Lee <dlee@digium.com>
Tue, 21 May 2013 22:49:23 +0000 (22:49 +0000)
committerDavid M. Lee <dlee@digium.com>
Tue, 21 May 2013 22:49:23 +0000 (22:49 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@389454 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/stasis_bridging.c

index 2ee4fcf..49e1fcf 100644 (file)
@@ -321,15 +321,17 @@ struct ast_json *ast_bridge_snapshot_to_json(const struct ast_bridge_snapshot *s
 
 void ast_stasis_bridging_shutdown(void)
 {
-       STASIS_MESSAGE_TYPE_CLEANUP(ast_bridge_snapshot_type);
-       STASIS_MESSAGE_TYPE_CLEANUP(ast_bridge_merge_message_type);
-       STASIS_MESSAGE_TYPE_CLEANUP(ast_channel_entered_bridge_type);
-       STASIS_MESSAGE_TYPE_CLEANUP(ast_channel_left_bridge_type);
        ao2_cleanup(bridge_topic_all);
        bridge_topic_all = NULL;
-       bridge_topic_all_cached = stasis_caching_unsubscribe(bridge_topic_all_cached);
+       bridge_topic_all_cached = stasis_caching_unsubscribe_and_join(
+               bridge_topic_all_cached);
        ao2_cleanup(bridge_topic_pool);
        bridge_topic_pool = NULL;
+
+       STASIS_MESSAGE_TYPE_CLEANUP(ast_bridge_snapshot_type);
+       STASIS_MESSAGE_TYPE_CLEANUP(ast_bridge_merge_message_type);
+       STASIS_MESSAGE_TYPE_CLEANUP(ast_channel_entered_bridge_type);
+       STASIS_MESSAGE_TYPE_CLEANUP(ast_channel_left_bridge_type);
 }
 
 /*! \brief snapshot ID getter for caching topic */