[asterisk-commits] rmudgett: branch 10 r377105 - in /branches/10: ./ main/config.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Dec 3 13:31:05 CST 2012


Author: rmudgett
Date: Mon Dec  3 13:31:01 2012
New Revision: 377105

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=377105
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

Modified:
    branches/10/   (props changed)
    branches/10/main/config.c

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/main/config.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/main/config.c?view=diff&rev=377105&r1=377104&r2=377105
==============================================================================
--- branches/10/main/config.c (original)
+++ branches/10/main/config.c Mon Dec  3 13:31:01 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