[asterisk-commits] rmudgett: trunk r377107 - in /trunk: ./ main/config.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Dec 3 13:33:10 CST 2012
Author: rmudgett
Date: Mon Dec 3 13:33:06 2012
New Revision: 377107
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=377107
Log:
Cleanup config cache on exit.
(issue ASTERISK-20649)
Reported by: Corey Farrell
Patches:
config-cleanup-all.patch (license #5909) patch uploaded by Corey Farrell
........
Merged revisions 377104 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 377105 from http://svn.asterisk.org/svn/asterisk/branches/10
........
Merged revisions 377106 from http://svn.asterisk.org/svn/asterisk/branches/11
Modified:
trunk/ (props changed)
trunk/main/config.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.
Modified: trunk/main/config.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/config.c?view=diff&rev=377107&r1=377106&r2=377107
==============================================================================
--- trunk/main/config.c (original)
+++ trunk/main/config.c Mon Dec 3 13:33:06 2012
@@ -3131,9 +3131,23 @@
AST_CLI_DEFINE(handle_cli_config_list, "Show all files that have loaded a configuration file"),
};
+static void config_shutdown(void)
+{
+ struct cache_file_mtime *cfmtime;
+
+ AST_LIST_LOCK(&cfmtime_head);
+ while ((cfmtime = AST_LIST_REMOVE_HEAD(&cfmtime_head, list))) {
+ ast_free(cfmtime);
+ }
+ AST_LIST_UNLOCK(&cfmtime_head);
+
+ ast_cli_unregister_multiple(cli_config, ARRAY_LEN(cli_config));
+}
+
int register_config_cli(void)
{
ast_cli_register_multiple(cli_config, ARRAY_LEN(cli_config));
+ ast_register_atexit(config_shutdown);
return 0;
}
More information about the asterisk-commits
mailing list