Fix registering core show codecs/codec CLI commands twice.
authorRichard Mudgett <rmudgett@digium.com>
Wed, 5 Dec 2012 02:20:57 +0000 (02:20 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 5 Dec 2012 02:20:57 +0000 (02:20 +0000)
........

Merged revisions 377241 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 377244 from http://svn.asterisk.org/svn/asterisk/branches/11

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

main/format.c

index 139dfd3..cea89a2 100644 (file)
@@ -911,7 +911,6 @@ static struct ast_cli_entry my_clis[] = {
 };
 int init_framer(void)
 {
-       ast_cli_register_multiple(my_clis, ARRAY_LEN(my_clis));
        return 0;
 }
 
@@ -1113,6 +1112,7 @@ init_list_cleanup:
 /*! \internal \brief Clean up resources on Asterisk shutdown */
 static void format_attr_shutdown(void)
 {
+       ast_cli_unregister_multiple(my_clis, ARRAY_LEN(my_clis));
        if (interfaces) {
                ao2_ref(interfaces, -1);
                interfaces = NULL;
@@ -1121,13 +1121,13 @@ static void format_attr_shutdown(void)
 
 int ast_format_attr_init(void)
 {
-       ast_cli_register_multiple(my_clis, ARRAY_LEN(my_clis));
-
        interfaces = ao2_container_alloc_options(AO2_ALLOC_OPT_LOCK_RWLOCK,
                283, interface_hash_cb, interface_cmp_cb);
        if (!interfaces) {
                return -1;
        }
+
+       ast_cli_register_multiple(my_clis, ARRAY_LEN(my_clis));
        ast_register_atexit(format_attr_shutdown);
        return 0;
 }