From: Corey Farrell Date: Sun, 13 Jul 2014 16:44:56 +0000 (+0000) Subject: Fix minor reference leaks in app_skel and TEST_FRAMEWORK X-Git-Tag: 12.5.0-rc1~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=108347eec8ab92f4d90aab755ab50d397cc48235;p=thirdparty%2Fasterisk.git Fix minor reference leaks in app_skel and TEST_FRAMEWORK * Cleanup games object in app_skel. * Cleanup stasis subscription to TEST_FRAMEWORK in manager.c (12+). Review: https://reviewboard.asterisk.org/r/3757/ ........ Merged revisions 418465 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@418466 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_skel.c b/apps/app_skel.c index 8a5b5bc750..249b1b6757 100644 --- a/apps/app_skel.c +++ b/apps/app_skel.c @@ -702,6 +702,7 @@ static int unload_module(void) ast_cli_unregister_multiple(skel_cli, ARRAY_LEN(skel_cli)); aco_info_destroy(&cfg_info); ao2_global_obj_release(globals); + ao2_cleanup(games); return ast_unregister_application(app); } diff --git a/main/manager.c b/main/manager.c index 2fbc3f653e..cb242c4a02 100644 --- a/main/manager.c +++ b/main/manager.c @@ -1139,6 +1139,10 @@ static struct stasis_forward *rtp_topic_forwarder; /*! \brief The \ref stasis_subscription for forwarding the Security topic to the AMI topic */ static struct stasis_forward *security_topic_forwarder; +#ifdef TEST_FRAMEWORK +struct stasis_subscription *test_suite_sub; +#endif + #define MGR_SHOW_TERMINAL_WIDTH 80 #define MAX_VARS 128 @@ -7958,6 +7962,10 @@ static void manager_shutdown(void) ao2_t_global_obj_release(event_docs, "Dispose of event_docs"); #endif +#ifdef TEST_FRAMEWORK + stasis_unsubscribe(test_suite_sub); +#endif + if (stasis_router) { stasis_message_router_unsubscribe_and_join(stasis_router); stasis_router = NULL; @@ -8149,7 +8157,7 @@ static int __init_manager(int reload, int by_external_config) ast_manager_register_xml_core("BlindTransfer", EVENT_FLAG_CALL, action_blind_transfer); #ifdef TEST_FRAMEWORK - stasis_subscribe(ast_test_suite_topic(), test_suite_event_cb, NULL); + test_suite_sub = stasis_subscribe(ast_test_suite_topic(), test_suite_event_cb, NULL); #endif ast_cli_register_multiple(cli_manager, ARRAY_LEN(cli_manager));