From: Richard Mudgett Date: Tue, 11 Dec 2012 21:07:47 +0000 (+0000) Subject: Cleanup udptl on exit. X-Git-Tag: 10.12.0-rc2~3^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e17a83acf69918b545d7367fe48853cc316bd3bb;p=thirdparty%2Fasterisk.git 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 ........ Merged revisions 377847 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@377848 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/udptl.c b/main/udptl.c index 75c48dcd77..29d24b713a 100644 --- a/main/udptl.c +++ b/main/udptl.c @@ -1421,8 +1421,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); }