mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
Cleanup core main on exit.
* Cleanup time zones on exit. * Make exit clean/unclean report consistent for AMI and CLI in really_quit(). (issue ASTERISK-20649) Reported by: Corey Farrell Patches: core-cleanup-1_8-10.patch (license #5909) patch uploaded by Corey Farrell core-cleanup-11-trunk.patch (license #5909) patch uploaded by Corey Farrell Modified ........ Merged revisions 377135 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 377136 from http://svn.asterisk.org/svn/asterisk/branches/10 ........ Merged revisions 377137 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@377138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -71,6 +71,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "private.h"
|
||||
#include "tzfile.h"
|
||||
|
||||
#include "asterisk/_private.h"
|
||||
#include "asterisk/lock.h"
|
||||
#include "asterisk/localtime.h"
|
||||
#include "asterisk/strings.h"
|
||||
@@ -444,7 +445,7 @@ static void *kqueue_daemon(void *data)
|
||||
closedir(sp->dir);
|
||||
}
|
||||
#endif
|
||||
free(sp);
|
||||
ast_free(sp);
|
||||
|
||||
/* Just in case the signal was sent late */
|
||||
AST_LIST_LOCK(&zonelist);
|
||||
@@ -1436,6 +1437,17 @@ static int gmtload(struct state *sp)
|
||||
return -1;
|
||||
}
|
||||
|
||||
void clean_time_zones(void)
|
||||
{
|
||||
struct state *sp;
|
||||
|
||||
AST_LIST_LOCK(&zonelist);
|
||||
while ((sp = AST_LIST_REMOVE_HEAD(&zonelist, list))) {
|
||||
ast_free(sp);
|
||||
}
|
||||
AST_LIST_UNLOCK(&zonelist);
|
||||
}
|
||||
|
||||
static const struct state *ast_tzset(const char *zone)
|
||||
{
|
||||
struct state *sp;
|
||||
|
Reference in New Issue
Block a user