mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-10 20:08:16 +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
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@377135 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"
|
||||
@@ -427,7 +428,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);
|
||||
@@ -1417,6 +1418,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