[asterisk-commits] kmoore: branch kmoore/stasis-device_state r383217 - in /team/kmoore/stasis-de...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Mar 15 09:17:26 CDT 2013


Author: kmoore
Date: Fri Mar 15 09:17:22 2013
New Revision: 383217

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=383217
Log:
Take advantage of stasis unsubscription functions returning NULL

Modified:
    team/kmoore/stasis-device_state/apps/app_queue.c
    team/kmoore/stasis-device_state/main/ccss.c
    team/kmoore/stasis-device_state/main/devicestate.c
    team/kmoore/stasis-device_state/main/pbx.c
    team/kmoore/stasis-device_state/res/res_jabber.c
    team/kmoore/stasis-device_state/res/res_xmpp.c

Modified: team/kmoore/stasis-device_state/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-device_state/apps/app_queue.c?view=diff&rev=383217&r1=383216&r2=383217
==============================================================================
--- team/kmoore/stasis-device_state/apps/app_queue.c (original)
+++ team/kmoore/stasis-device_state/apps/app_queue.c Fri Mar 15 09:17:22 2013
@@ -9854,7 +9854,7 @@
 	res |= ast_data_unregister(NULL);
 
 	if (device_state_sub) {
-		stasis_unsubscribe(device_state_sub);
+		device_state_sub = stasis_unsubscribe(device_state_sub);
 	}
 
 	ast_extension_state_del(0, extension_state_cb);

Modified: team/kmoore/stasis-device_state/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-device_state/main/ccss.c?view=diff&rev=383217&r1=383216&r2=383217
==============================================================================
--- team/kmoore/stasis-device_state/main/ccss.c (original)
+++ team/kmoore/stasis-device_state/main/ccss.c Fri Mar 15 09:17:22 2013
@@ -1260,8 +1260,7 @@
 	struct generic_monitor_instance_list *generic_list = obj;
 	struct generic_monitor_instance *generic_instance;
 
-	stasis_unsubscribe(generic_list->sub);
-	generic_list->sub = NULL;
+	generic_list->sub = stasis_unsubscribe(generic_list->sub);
 	while ((generic_instance = AST_LIST_REMOVE_HEAD(&generic_list->list, next))) {
 		ast_free(generic_instance);
 	}
@@ -2651,8 +2650,7 @@
 		return;
 	}
 
-	stasis_unsubscribe(sub);
-	generic_pvt->sub = NULL;
+	generic_pvt->sub = stasis_unsubscribe(sub);
 	ast_cc_agent_caller_available(agent->core_id, "%s is no longer busy", agent->device_name);
 }
 
@@ -2785,8 +2783,7 @@
 
 	cc_generic_agent_stop_offer_timer(agent);
 	if (agent_pvt->sub) {
-		stasis_unsubscribe(agent_pvt->sub);
-		agent_pvt->sub = NULL;
+		agent_pvt->sub = stasis_unsubscribe(agent_pvt->sub);
 	}
 
 	ast_free(agent_pvt);

Modified: team/kmoore/stasis-device_state/main/devicestate.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-device_state/main/devicestate.c?view=diff&rev=383217&r1=383216&r2=383217
==============================================================================
--- team/kmoore/stasis-device_state/main/devicestate.c (original)
+++ team/kmoore/stasis-device_state/main/devicestate.c Fri Mar 15 09:17:22 2013
@@ -212,8 +212,7 @@
 	struct device_state_topic *topic = obj;
 	ast_free(topic->device);
 	topic->device = NULL;
-	stasis_unsubscribe(topic->forward);
-	topic->forward = NULL;
+	topic->forward = stasis_unsubscribe(topic->forward);
 	ao2_cleanup(topic->topic);
 	topic->topic = NULL;
 }
@@ -838,8 +837,7 @@
 {
 	ao2_cleanup(device_state_topic_all);
 	device_state_topic_all = NULL;
-	stasis_caching_unsubscribe(device_state_topic_cached);
-	device_state_topic_cached = NULL;
+	device_state_topic_cached = stasis_caching_unsubscribe(device_state_topic_cached);
 	ao2_cleanup(device_state_message_type);
 	device_state_message_type = NULL;
 	ao2_cleanup(device_state_topics);

Modified: team/kmoore/stasis-device_state/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-device_state/main/pbx.c?view=diff&rev=383217&r1=383216&r2=383217
==============================================================================
--- team/kmoore/stasis-device_state/main/pbx.c (original)
+++ team/kmoore/stasis-device_state/main/pbx.c Fri Mar 15 09:17:22 2013
@@ -11776,8 +11776,7 @@
 		presence_state_sub = ast_event_unsubscribe(presence_state_sub);
 	}
 	if (device_state_sub) {
-		stasis_unsubscribe(device_state_sub);
-		device_state_sub = NULL;
+		device_state_sub = stasis_unsubscribe(device_state_sub);
 	}
 
 	/* Unregister builtin applications */

Modified: team/kmoore/stasis-device_state/res/res_jabber.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-device_state/res/res_jabber.c?view=diff&rev=383217&r1=383216&r2=383217
==============================================================================
--- team/kmoore/stasis-device_state/res/res_jabber.c (original)
+++ team/kmoore/stasis-device_state/res/res_jabber.c Fri Mar 15 09:17:22 2013
@@ -4776,7 +4776,7 @@
 		ast_event_unsubscribe(mwi_sub);
 	}
 	if (device_state_sub) {
-		stasis_unsubscribe(device_state_sub);
+		device_state_sub = stasis_unsubscribe(device_state_sub);
 	}
 	ast_custom_function_unregister(&jabberreceive_function);
 

Modified: team/kmoore/stasis-device_state/res/res_xmpp.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-device_state/res/res_xmpp.c?view=diff&rev=383217&r1=383216&r2=383217
==============================================================================
--- team/kmoore/stasis-device_state/res/res_xmpp.c (original)
+++ team/kmoore/stasis-device_state/res/res_xmpp.c Fri Mar 15 09:17:22 2013
@@ -3515,8 +3515,7 @@
 	}
 
 	if (client->device_state_sub) {
-		stasis_unsubscribe(client->device_state_sub);
-		client->device_state_sub = NULL;
+		client->device_state_sub = stasis_unsubscribe(client->device_state_sub);
 		xmpp_pubsub_unsubscribe(client, "device_state");
 	}
 




More information about the asterisk-commits mailing list