mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-02 19:16:15 +00:00
Fix a variety of ref counting issues
This patch resolves a number of ref leaks that occur primarily on Asterisk shutdown. It adds a variety of shutdown routines to core portions of Asterisk such that they can reclaim resources allocate duringd initialization. Review: https://reviewboard.asterisk.org/r/2137 ........ Merged revisions 374177 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 374178 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 374196 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1150,6 +1150,15 @@ int ast_tone_zone_data_add_structure(struct ast_data *tree, struct ast_tone_zone
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*! \internal \brief Clean up resources on Asterisk shutdown */
|
||||
static void indications_shutdown(void)
|
||||
{
|
||||
if (ast_tone_zones) {
|
||||
ao2_ref(ast_tone_zones, -1);
|
||||
ast_tone_zones = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*! \brief Load indications module */
|
||||
int ast_indications_init(void)
|
||||
{
|
||||
@@ -1164,6 +1173,7 @@ int ast_indications_init(void)
|
||||
|
||||
ast_cli_register_multiple(cli_indications, ARRAY_LEN(cli_indications));
|
||||
|
||||
ast_register_atexit(indications_shutdown);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user