[svn-commits] mmichelson: branch group/CCSS_Monitor_Restructure r244384 - /team/group/CCSS_...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Feb 2 13:46:25 CST 2010


Author: mmichelson
Date: Tue Feb  2 13:46:23 2010
New Revision: 244384

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=244384
Log:
Add some module refcounting on the SIP monitor.


Modified:
    team/group/CCSS_Monitor_Restructure/channels/chan_sip.c

Modified: team/group/CCSS_Monitor_Restructure/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/channels/chan_sip.c?view=diff&rev=244384&r1=244383&r2=244384
==============================================================================
--- team/group/CCSS_Monitor_Restructure/channels/chan_sip.c (original)
+++ team/group/CCSS_Monitor_Restructure/channels/chan_sip.c Tue Feb  2 13:46:23 2010
@@ -3801,6 +3801,7 @@
 {
 	struct sip_monitor_instance *monitor_instance = private_data;
 	ao2_unlink(sip_monitor_instances, monitor_instance);
+	ast_module_unref(ast_module_info->self);
 }
 
 static int sip_get_cc_information(struct sip_request *req, char *subscribe_uri, size_t size, enum ast_cc_service_type *service)
@@ -3907,7 +3908,11 @@
 			/* Same deal. We can try using generic still */
 			goto generic;
 		}
-		/* We're all set! */
+		/* We bump the refcount of chan_sip because once we queue this frame, the CC core
+		 * will have a reference to callbacks in this module. We decrement the module
+		 * refcount once the monitor destructor is called
+		 */
+		ast_module_ref(ast_module_info->self);
 		ast_queue_cc_frame(pvt->owner, "SIP", interface_name, offered_service, monitor_instance);
 		ao2_ref(monitor_instance, -1);
 		return;




More information about the svn-commits mailing list