[asterisk-commits] mjordan: branch 1.8 r386641 - /branches/1.8/main/features.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 26 16:11:36 CDT 2013


Author: mjordan
Date: Fri Apr 26 16:11:33 2013
New Revision: 386641

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=386641
Log:
Clean up resources in features on exit

This patch cleans up two things features:
* It properly unregisters the CLI commands that features registered
* It cancels and performs a pthread_join on the created parking thread. This
  not only properly joins a non-detached thread, but also prevents disposing
  of the parking lots prior to the parking thread completely exiting.

(closes issue ASTERISK-21407)
Reported by: Corey Farrell
patches:
  features_shutdown-r2.patch uploaded by Corey Farrell (License 5909)

Modified:
    branches/1.8/main/features.c

Modified: branches/1.8/main/features.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/features.c?view=diff&rev=386641&r1=386640&r2=386641
==============================================================================
--- branches/1.8/main/features.c (original)
+++ branches/1.8/main/features.c Fri Apr 26 16:11:33 2013
@@ -8269,6 +8269,7 @@
 /*! \internal \brief Clean up resources on Asterisk shutdown */
 static void features_shutdown(void)
 {
+	ast_cli_unregister_multiple(cli_features, ARRAY_LEN(cli_features));
 	ast_devstate_prov_del("Park");
 	ast_manager_unregister("Bridge");
 	ast_manager_unregister("Park");
@@ -8279,6 +8280,9 @@
 	ast_unregister_application(app_bridge);
 
 	pthread_cancel(parking_thread);
+	pthread_kill(parking_thread, SIGURG);
+	pthread_join(parking_thread, NULL);
+	ast_context_destroy(NULL, registrar);
 	ao2_ref(parkinglots, -1);
 }
 




More information about the asterisk-commits mailing list