[asterisk-commits] mmichelson: branch group/CCSS r220294 - /team/group/CCSS/main/ccss.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 24 14:57:29 CDT 2009


Author: mmichelson
Date: Thu Sep 24 14:57:23 2009
New Revision: 220294

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=220294
Log:
Perform monitor destruction properly.

Next up is a big ol' round of tests to be sure all
is well.


Modified:
    team/group/CCSS/main/ccss.c

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=220294&r1=220293&r2=220294
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Thu Sep 24 14:57:23 2009
@@ -454,6 +454,7 @@
 void ast_cc_interface_destroy(void *data)
 {
 	struct ast_cc_interface *interface = data;
+	ast_log(LOG_NOTICE, "Destroying cc interface %s\n", interface->name);
 	ast_cc_config_params_destroy(interface->config_params);
 }
 
@@ -890,6 +891,13 @@
 	return callbacks;
 }
 
+static void monitor_destroy(void *data)
+{
+	struct ast_cc_monitor *monitor = data;
+	ao2_ref(monitor->interface, -1);
+	monitor->callbacks->destructor(monitor);
+}
+
 static struct ast_cc_monitor *cc_monitor_instance_init(struct ast_cc_interface *cc_interface,
 		const int core_id)
 {
@@ -898,7 +906,7 @@
 
 	ast_assert(callbacks != NULL);
 
-	if (!(monitor = ao2_t_alloc(sizeof(*monitor), callbacks->destructor, "Allocating new monitor structure"))) {
+	if (!(monitor = ao2_t_alloc(sizeof(*monitor), monitor_destroy, "Allocating new monitor structure"))) {
 		return NULL;
 	}
 




More information about the asterisk-commits mailing list