[asterisk-commits] kmoore: trunk r383169 - in /trunk: main/ tests/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Mar 15 08:04:55 CDT 2013


Author: kmoore
Date: Fri Mar 15 08:04:52 2013
New Revision: 383169

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=383169
Log:
Take advantage of the fact that stasis_unsubscribe now returns NULL

Modified:
    trunk/main/channel_internal_api.c
    trunk/main/manager.c
    trunk/tests/test_stasis.c

Modified: trunk/main/channel_internal_api.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/channel_internal_api.c?view=diff&rev=383169&r1=383168&r2=383169
==============================================================================
--- trunk/main/channel_internal_api.c (original)
+++ trunk/main/channel_internal_api.c Fri Mar 15 08:04:52 2013
@@ -1367,8 +1367,7 @@
 
 	ast_string_field_free_memory(chan);
 
-	stasis_unsubscribe(chan->forwarder);
-	chan->forwarder = NULL;
+	chan->forwarder = stasis_unsubscribe(chan->forwarder);
 
 	ao2_cleanup(chan->topic);
 	chan->topic = NULL;

Modified: trunk/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/manager.c?view=diff&rev=383169&r1=383168&r2=383169
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Fri Mar 15 08:04:52 2013
@@ -7590,8 +7590,7 @@
 {
 	struct ast_manager_user *user;
 
-	stasis_unsubscribe(channel_state_sub);
-	channel_state_sub = NULL;
+	channel_state_sub = stasis_unsubscribe(channel_state_sub);
 
 	if (registered) {
 		ast_manager_unregister("Ping");

Modified: trunk/tests/test_stasis.c
URL: http://svnview.digium.com/svn/asterisk/trunk/tests/test_stasis.c?view=diff&rev=383169&r1=383168&r2=383169
==============================================================================
--- trunk/tests/test_stasis.c (original)
+++ trunk/tests/test_stasis.c Fri Mar 15 08:04:52 2013
@@ -276,8 +276,7 @@
 	ao2_ref(consumer, +1);
 	expected_uniqueid = ast_strdup(stasis_subscription_uniqueid(uut));
 
-	stasis_unsubscribe(uut);
-	uut = NULL;
+	uut = stasis_unsubscribe(uut);
 	complete = consumer_wait_for_completion(consumer);
 	ast_test_validate(test, 1 == complete);
 
@@ -376,8 +375,7 @@
 	ast_test_validate(test, NULL != uut);
 	ao2_ref(consumer, +1);
 
-	stasis_unsubscribe(uut);
-	uut = NULL;
+	uut = stasis_unsubscribe(uut);
 
 	test_data = ao2_alloc(1, NULL);
 	ast_test_validate(test, NULL != test_data);




More information about the asterisk-commits mailing list