diff options
author | Jonathan Rose <jrose@digium.com> | 2013-10-24 19:31:23 +0000 |
---|---|---|
committer | Jonathan Rose <jrose@digium.com> | 2013-10-24 19:31:23 +0000 |
commit | 95d8977e22eea070cf122d252cb585a3ed1a1d41 (patch) | |
tree | f360549890dd4700e851f83f6b8e3e701bc5759a /main | |
parent | 713ac0872bc23dbcaf27d6752e49a32c2dd94ec0 (diff) |
astobj2: Unregister debug CLI commands at exit
(issue ASTERISK-22467)
Reported by: Corey Farrell
Patches:
astobj2-clean-debug-cli-1.8-11.patch uploaded by coreyfarrell (license 5909)
astobj2-clean-debug-cli-12up.patch uploaded by coreyfarrell (license 5909)
........
Merged revisions 401781 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 401783 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 401784 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r-- | main/astobj2.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/main/astobj2.c b/main/astobj2.c index 88801bd2f..614e17096 100644 --- a/main/astobj2.c +++ b/main/astobj2.c @@ -5576,11 +5576,14 @@ static struct ast_cli_entry cli_astobj2[] = { }; #endif /* defined(AO2_DEBUG) || defined(AST_DEVMODE) */ -#if defined(AST_DEVMODE) +#if defined(AO2_DEBUG) || defined(AST_DEVMODE) static void astobj2_cleanup(void) { +#if defined(AST_DEVMODE) ao2_t_ref(reg_containers, -1, "Releasing container registration container"); reg_containers = NULL; +#endif + ast_cli_unregister_multiple(cli_astobj2, ARRAY_LEN(cli_astobj2)); } #endif @@ -5593,10 +5596,10 @@ int astobj2_init(void) if (!reg_containers) { return -1; } - ast_register_atexit(astobj2_cleanup); #endif /* defined(AST_DEVMODE) */ #if defined(AO2_DEBUG) || defined(AST_DEVMODE) ast_cli_register_multiple(cli_astobj2, ARRAY_LEN(cli_astobj2)); + ast_register_atexit(astobj2_cleanup); #endif /* defined(AO2_DEBUG) || defined(AST_DEVMODE) */ return 0; |