summaryrefslogtreecommitdiff
path: root/include/asterisk/channel.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asterisk/channel.h')
-rw-r--r--include/asterisk/channel.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index 1b36c14ae..fae43d423 100644
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -2596,6 +2596,17 @@ struct ast_group_info {
*/
#define ast_channel_unref(c) ({ ao2_ref(c, -1); (struct ast_channel *) (NULL); })
+/*!
+ * \brief Cleanup a channel reference
+ *
+ * \param c the channel (NULL tolerant)
+ *
+ * \retval NULL always
+ *
+ * \since 12.0.0
+ */
+#define ast_channel_cleanup(c) ({ ao2_cleanup(c); (struct ast_channel *) (NULL); })
+
/*! Channel Iterating @{ */
/*!