[asterisk-commits] russell: trunk r190989 - in /trunk: include/asterisk/channel.h main/rtp_engine.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Apr 29 03:51:25 CDT 2009


Author: russell
Date: Wed Apr 29 03:51:21 2009
New Revision: 190989

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=190989
Log:
Resolve Solaris build issues and add some API documentation.

(issue #14981)
Reported by: snuffy

Modified:
    trunk/include/asterisk/channel.h
    trunk/main/rtp_engine.c

Modified: trunk/include/asterisk/channel.h
URL: http://svn.digium.com/svn-view/asterisk/trunk/include/asterisk/channel.h?view=diff&rev=190989&r1=190988&r2=190989
==============================================================================
--- trunk/include/asterisk/channel.h (original)
+++ trunk/include/asterisk/channel.h Wed Apr 29 03:51:21 2009
@@ -2073,8 +2073,27 @@
 		} \
 	} while (0)
 
+/*!
+ * \brief Increase channel reference count
+ *
+ * \param c the channel
+ *
+ * \retval c always
+ *
+ * \since 1.6.3
+ */
 #define ast_channel_ref(c) ({ ao2_ref(c, +1); (c); })
-#define ast_channel_unref(c) ({ ao2_ref(c, -1); (NULL); })
+
+/*!
+ * \brief Decrease channel reference count
+ *
+ * \param c the channel
+ *
+ * \retval NULL always
+ *
+ * \since 1.6.3
+ */
+#define ast_channel_unref(c) ({ ao2_ref(c, -1); (struct ast_channel *) (NULL); })
 
 /*! Channel Iterating @{ */
 

Modified: trunk/main/rtp_engine.c
URL: http://svn.digium.com/svn-view/asterisk/trunk/main/rtp_engine.c?view=diff&rev=190989&r1=190988&r2=190989
==============================================================================
--- trunk/main/rtp_engine.c (original)
+++ trunk/main/rtp_engine.c Wed Apr 29 03:51:21 2009
@@ -1540,7 +1540,8 @@
 
 	if (!peer_instance || peer_instance->engine != instance->engine) {
 		ast_channel_unlock(peer);
-		peer_instance = (ao2_ref(peer_instance, -1), NULL);
+		ao2_ref(peer_instance, -1);
+		peer_instance = NULL;
 		return -1;
 	}
 
@@ -1548,7 +1549,8 @@
 
 	ast_channel_unlock(peer);
 
-	peer_instance = (ao2_ref(peer_instance, -1), NULL);
+	ao2_ref(peer_instance, -1);
+	peer_instance = NULL;
 
 	return res;
 }




More information about the asterisk-commits mailing list