mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-11-04 05:15:22 +00:00 
			
		
		
		
	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
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377107 65c4cc65-6c06-0410-ace0-fbb531ad65f3
			
			
This commit is contained in:
		@@ -3131,9 +3131,23 @@ static struct ast_cli_entry cli_config[] = {
 | 
			
		||||
	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;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user