[asterisk-commits] rmudgett: branch 1.8 r377104 - /branches/1.8/main/config.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Dec 3 13:29:21 CST 2012
Author: rmudgett
Date: Mon Dec 3 13:29:17 2012
New Revision: 377104
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=377104
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
Modified:
branches/1.8/main/config.c
Modified: branches/1.8/main/config.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/config.c?view=diff&rev=377104&r1=377103&r2=377104
==============================================================================
--- branches/1.8/main/config.c (original)
+++ branches/1.8/main/config.c Mon Dec 3 13:29:17 2012
@@ -2952,8 +2952,22 @@
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