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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@377105 65c4cc65-6c06-0410-ace0-fbb531ad65f3
10
Richard Mudgett 13 years ago
parent eab7f58d9e
commit 6a97e41ef0

@ -2952,8 +2952,22 @@ 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;
}

Loading…
Cancel
Save