From e5c5d7abe89fe225191cd74825950b9d79d22dda Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Tue, 11 Dec 2012 21:05:07 +0000 Subject: [PATCH] Cleanup udptl on exit. * Cleanup CLI commands on exit. (issue ASTERISK-20649) Reported by: Corey Farrell Patches: udptl-shutdown-1_8-10.patch (license #5909) patch uploaded by Corey Farrell udptl-shutdown-11-trunk.patch (license #5909) patch uploaded by Corey Farrell Modified git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@377847 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/udptl.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/main/udptl.c b/main/udptl.c index c039b650fe..00989b46ee 100644 --- a/main/udptl.c +++ b/main/udptl.c @@ -1418,8 +1418,20 @@ int ast_udptl_reload(void) return 0; } +/*! + * \internal + * \brief Clean up resources on Asterisk shutdown + */ +static void udptl_shutdown(void) +{ + ast_cli_unregister_multiple(cli_udptl, ARRAY_LEN(cli_udptl)); +} + void ast_udptl_init(void) { - ast_cli_register_multiple(cli_udptl, ARRAY_LEN(cli_udptl)); __ast_udptl_reload(0); + + ast_cli_register_multiple(cli_udptl, ARRAY_LEN(cli_udptl)); + + ast_register_atexit(udptl_shutdown); } -- 2.47.3