Clean up MWI topic pool before message type destruction
authorMatthew Jordan <mjordan@digium.com>
Sun, 9 Jun 2013 21:11:25 +0000 (21:11 +0000)
committerMatthew Jordan <mjordan@digium.com>
Sun, 9 Jun 2013 21:11:25 +0000 (21:11 +0000)
Topics need to be disposed of prior to the message types that are published
on them. This includes topic pools. This prevents an assertion from being
raised on shutdown.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@391040 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/app.c

index 03c1a1e..0b829cc 100644 (file)
@@ -2818,13 +2818,13 @@ struct stasis_message *ast_mwi_blob_create(struct ast_mwi_state *mwi_state,
 
 static void app_cleanup(void)
 {
+       ao2_cleanup(mwi_topic_pool);
+       mwi_topic_pool = NULL;
        ao2_cleanup(mwi_topic_all);
        mwi_topic_all = NULL;
        mwi_topic_cached = stasis_caching_unsubscribe_and_join(mwi_topic_cached);
        STASIS_MESSAGE_TYPE_CLEANUP(ast_mwi_state_type);
        STASIS_MESSAGE_TYPE_CLEANUP(ast_mwi_vm_app_type);
-       ao2_cleanup(mwi_topic_pool);
-       mwi_topic_pool = NULL;
 }
 
 int app_init(void)