[asterisk-commits] rmudgett: branch 10 r377838 - in /branches/10: ./ main/taskprocessor.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 11 14:43:03 CST 2012


Author: rmudgett
Date: Tue Dec 11 14:42:59 2012
New Revision: 377838

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=377838
Log:
Cleanup taskprocessor on exit.

* Cleanup CLI commands on exit.

* v10 only: Merged v1.8 -r374177 change to taskprocessor.c missed in v10 -r374178.

(issue ASTERISK-20649)
Reported by: Corey Farrell
Patches:
      taskprocessor-cleanup-1_8-11-trunk.patch (license #5909) patch uploaded by Corey Farrell
      taskprocessor-cleanup-10-only.patch (license #5909) patch uploaded by Corey Farrell
      Modified
........

Merged revisions 377837 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/10/   (props changed)
    branches/10/main/taskprocessor.c

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/main/taskprocessor.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/main/taskprocessor.c?view=diff&rev=377838&r1=377837&r2=377838
==============================================================================
--- branches/10/main/taskprocessor.c (original)
+++ branches/10/main/taskprocessor.c Tue Dec 11 14:42:59 2012
@@ -122,6 +122,17 @@
 	AST_CLI_DEFINE(cli_tps_report, "List instantiated task processors and statistics"),
 };
 
+/*!
+ * \internal
+ * \brief Clean up resources on Asterisk shutdown
+ */
+static void tps_shutdown(void)
+{
+	ast_cli_unregister_multiple(taskprocessor_clis, ARRAY_LEN(taskprocessor_clis));
+	ao2_t_ref(tps_singletons, -1, "Unref tps_singletons in shutdown");
+	tps_singletons = NULL;
+}
+
 /* initialize the taskprocessor container and register CLI operations */
 int ast_tps_init(void)
 {
@@ -133,6 +144,9 @@
 	ast_cond_init(&cli_ping_cond, NULL);
 
 	ast_cli_register_multiple(taskprocessor_clis, ARRAY_LEN(taskprocessor_clis));
+
+	ast_register_atexit(tps_shutdown);
+
 	return 0;
 }
 




More information about the asterisk-commits mailing list