From: Matthew Jordan Date: Wed, 3 Oct 2012 17:27:53 +0000 (+0000) Subject: Destroy the generic_monitors container after the core_instances in ccss X-Git-Tag: 13.0.0-beta1~2462 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9367893cff8b69dd070adcce06ca9b5a998188cc;p=thirdparty%2Fasterisk.git Destroy the generic_monitors container after the core_instances in ccss For each item in core_instances disposed of in the shutdown of ccss, any generic monitor instances referenced by the objects will be removed from generic_monitors during their destruction. Hilarity ensues if generic_monitors no longer exists. Thanks to the Asterisk Test Suite's generic_ccss test for complaining loudly when it ran into this. ........ Merged revisions 374300 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 374301 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374302 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/ccss.c b/main/ccss.c index a45ed2844b..5dd1d70bfd 100644 --- a/main/ccss.c +++ b/main/ccss.c @@ -4535,14 +4535,15 @@ static void cc_shutdown(void) if (cc_core_taskprocessor) { cc_core_taskprocessor = ast_taskprocessor_unreference(cc_core_taskprocessor); } - if (generic_monitors) { - ao2_t_ref(generic_monitors, -1, "Unref generic_monitor container in cc_shutdown"); - generic_monitors = NULL; - } + /* Note that core instances must be destroyed prior to the generic_monitors */ if (cc_core_instances) { ao2_t_ref(cc_core_instances, -1, "Unref cc_core_instances container in cc_shutdown"); cc_core_instances = NULL; } + if (generic_monitors) { + ao2_t_ref(generic_monitors, -1, "Unref generic_monitor container in cc_shutdown"); + generic_monitors = NULL; + } } int ast_cc_init(void)