[asterisk-commits] rmudgett: branch 11 r377883 - in /branches/11: ./ main/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Dec 11 16:01:17 CST 2012
Author: rmudgett
Date: Tue Dec 11 16:01:13 2012
New Revision: 377883
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=377883
Log:
Cleanup CLI commands on exit for several files.
(issue ASTERISK-20649)
Reported by: Corey Farrell
Patches:
unregister-cli-multiple-all.patch (license #5909) patch uploaded by Corey Farrell
........
Merged revisions 377881 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 377882 from http://svn.asterisk.org/svn/asterisk/branches/10
Modified:
branches/11/ (props changed)
branches/11/main/aoc.c
branches/11/main/cel.c
branches/11/main/channel.c
branches/11/main/data.c
branches/11/main/file.c
branches/11/main/http.c
branches/11/main/image.c
branches/11/main/stun.c
branches/11/main/timing.c
Propchange: branches/11/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.
Modified: branches/11/main/aoc.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/aoc.c?view=diff&rev=377883&r1=377882&r2=377883
==============================================================================
--- branches/11/main/aoc.c (original)
+++ branches/11/main/aoc.c Tue Dec 11 16:01:13 2012
@@ -1605,7 +1605,12 @@
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));
}
Modified: branches/11/main/cel.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/cel.c?view=diff&rev=377883&r1=377882&r2=377883
==============================================================================
--- branches/11/main/cel.c (original)
+++ branches/11/main/cel.c Tue Dec 11 16:01:13 2012
@@ -720,6 +720,7 @@
ao2_ref(linkedids, -1);
linkedids = NULL;
}
+ ast_cli_unregister(&cli_status);
}
int ast_cel_engine_init(void)
Modified: branches/11/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/channel.c?view=diff&rev=377883&r1=377882&r2=377883
==============================================================================
--- branches/11/main/channel.c (original)
+++ branches/11/main/channel.c Tue Dec 11 16:01:13 2012
@@ -8551,8 +8551,10 @@
static void channels_shutdown(void)
{
ast_data_unregister(NULL);
+ ast_cli_unregister_multiple(cli_channel, ARRAY_LEN(cli_channel));
if (channels) {
ao2_ref(channels, -1);
+ channels = NULL;
}
}
Modified: branches/11/main/data.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/data.c?view=diff&rev=377883&r1=377882&r2=377883
==============================================================================
--- branches/11/main/data.c (original)
+++ branches/11/main/data.c Tue Dec 11 16:01:13 2012
@@ -3318,7 +3318,9 @@
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);
}
Modified: branches/11/main/file.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/file.c?view=diff&rev=377883&r1=377882&r2=377883
==============================================================================
--- branches/11/main/file.c (original)
+++ branches/11/main/file.c Tue Dec 11 16:01:13 2012
@@ -1583,8 +1583,14 @@
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;
}
Modified: branches/11/main/http.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/http.c?view=diff&rev=377883&r1=377882&r2=377883
==============================================================================
--- branches/11/main/http.c (original)
+++ branches/11/main/http.c Tue Dec 11 16:01:13 2012
@@ -1195,11 +1195,17 @@
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);
}
Modified: branches/11/main/image.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/image.c?view=diff&rev=377883&r1=377882&r2=377883
==============================================================================
--- branches/11/main/image.c (original)
+++ branches/11/main/image.c Tue Dec 11 16:01:13 2012
@@ -206,8 +206,14 @@
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;
}
Modified: branches/11/main/stun.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/stun.c?view=diff&rev=377883&r1=377882&r2=377883
==============================================================================
--- branches/11/main/stun.c (original)
+++ branches/11/main/stun.c Tue Dec 11 16:01:13 2012
@@ -504,8 +504,14 @@
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);
+}
Modified: branches/11/main/timing.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/timing.c?view=diff&rev=377883&r1=377882&r2=377883
==============================================================================
--- branches/11/main/timing.c (original)
+++ branches/11/main/timing.c Tue Dec 11 16:01:13 2012
@@ -299,11 +299,21 @@
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));
}
More information about the asterisk-commits
mailing list