Reset automerge property.
authorMark Michelson <mmichelson@digium.com>
Tue, 11 Dec 2012 22:25:21 +0000 (22:25 +0000)
committerMark Michelson <mmichelson@digium.com>
Tue, 11 Dec 2012 22:25:21 +0000 (22:25 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/team/mmichelson/threadpool@377903 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/aoc.c
main/cel.c
main/channel.c
main/data.c
main/file.c
main/http.c
main/image.c
main/stun.c
main/timing.c

index 79978b1..8a51509 100644 (file)
@@ -1605,7 +1605,12 @@ static struct ast_cli_entry aoc_cli[] = {
        AST_CLI_DEFINE(aoc_cli_debug_enable, "enable cli debugging of AOC messages"),
 };
 
+static void aoc_shutdown(void)
+{
+       ast_cli_unregister_multiple(aoc_cli, ARRAY_LEN(aoc_cli));
+}
 int ast_aoc_cli_init(void)
 {
+       ast_register_atexit(aoc_shutdown);
        return ast_cli_register_multiple(aoc_cli, ARRAY_LEN(aoc_cli));
 }
index 6af6174..85e2967 100644 (file)
@@ -729,6 +729,7 @@ static void ast_cel_engine_term(void)
                ao2_ref(linkedids, -1);
                linkedids = NULL;
        }
+       ast_cli_unregister(&cli_status);
 }
 
 int ast_cel_engine_init(void)
index 37fda09..ce3a58f 100644 (file)
@@ -8620,9 +8620,11 @@ static void prnt_channel_key(void *v_obj, void *where, ao2_prnt_fn *prnt)
 static void channels_shutdown(void)
 {
        ast_data_unregister(NULL);
+       ast_cli_unregister_multiple(cli_channel, ARRAY_LEN(cli_channel));
        if (channels) {
                ao2_container_unregister("channels");
                ao2_ref(channels, -1);
+               channels = NULL;
        }
 }
 
index 7a19b1f..44ba390 100644 (file)
@@ -3318,7 +3318,9 @@ AST_TEST_DEFINE(test_data_get)
 static void data_shutdown(void)
 {
        ast_manager_unregister("DataGet");
+       ast_cli_unregister_multiple(cli_data, ARRAY_LEN(cli_data));
        ao2_t_ref(root_data.container, -1, "Unref root_data.container in data_shutdown");
+       root_data.container = NULL;
        ast_rwlock_destroy(&root_data.lock);
 }
 
index 915ed98..db8fd5c 100644 (file)
@@ -1583,8 +1583,14 @@ static struct ast_cli_entry cli_file[] = {
        AST_CLI_DEFINE(handle_cli_core_show_file_formats, "Displays file formats")
 };
 
+static void file_shutdown(void)
+{
+       ast_cli_unregister_multiple(cli_file, ARRAY_LEN(cli_file));
+}
+
 int ast_file_init(void)
 {
        ast_cli_register_multiple(cli_file, ARRAY_LEN(cli_file));
+       ast_register_atexit(file_shutdown);
        return 0;
 }
index 6255252..44148ed 100644 (file)
@@ -1203,11 +1203,17 @@ static struct ast_cli_entry cli_http[] = {
        AST_CLI_DEFINE(handle_show_http, "Display HTTP server status"),
 };
 
+static void http_shutdown(void)
+{
+       ast_cli_unregister_multiple(cli_http, ARRAY_LEN(cli_http));
+}
+
 int ast_http_init(void)
 {
        ast_http_uri_link(&statusuri);
        ast_http_uri_link(&staticuri);
        ast_cli_register_multiple(cli_http, ARRAY_LEN(cli_http));
+       ast_register_atexit(http_shutdown);
 
        return __ast_http_load(0);
 }
index d3ca76f..08620d7 100644 (file)
@@ -206,8 +206,14 @@ static struct ast_cli_entry cli_image[] = {
        AST_CLI_DEFINE(handle_core_show_image_formats, "Displays image formats")
 };
 
+static void image_shutdown(void)
+{
+       ast_cli_unregister_multiple(cli_image, ARRAY_LEN(cli_image));
+}
+
 int ast_image_init(void)
 {
        ast_cli_register_multiple(cli_image, ARRAY_LEN(cli_image));
+       ast_register_atexit(image_shutdown);
        return 0;
 }
index a41dbac..3b4d2ad 100644 (file)
@@ -504,8 +504,14 @@ static struct ast_cli_entry cli_stun[] = {
        AST_CLI_DEFINE(handle_cli_stun_set_debug, "Enable/Disable STUN debugging"),
 };
 
+static void stun_shutdown(void)
+{
+       ast_cli_unregister_multiple(cli_stun, sizeof(cli_stun) / sizeof(struct ast_cli_entry));
+}
+
 /*! \brief Initialize the STUN system in Asterisk */
 void ast_stun_init(void)
 {
        ast_cli_register_multiple(cli_stun, sizeof(cli_stun) / sizeof(struct ast_cli_entry));
+       ast_register_atexit(stun_shutdown);
 }
index f2211d4..84bff08 100644 (file)
@@ -299,11 +299,21 @@ static struct ast_cli_entry cli_timing[] = {
        AST_CLI_DEFINE(timing_test, "Run a timing test"),
 };
 
+static void timing_shutdown(void)
+{
+       ast_cli_unregister_multiple(cli_timing, ARRAY_LEN(cli_timing));
+
+       ast_heap_destroy(timing_interfaces);
+       timing_interfaces = NULL;
+}
+
 int ast_timing_init(void)
 {
        if (!(timing_interfaces = ast_heap_create(2, timing_holder_cmp, 0))) {
                return -1;
        }
 
+       ast_register_atexit(timing_shutdown);
+
        return ast_cli_register_multiple(cli_timing, ARRAY_LEN(cli_timing));
 }