提交 d2a2be5d authored 作者: Anthony Minessale's avatar Anthony Minessale

make state_handler macros not let you install the same one more than once

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13111 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 130d3f38
......@@ -181,6 +181,8 @@ extern switch_io_event_hooks_t switch_core_session_get_event_hooks(switch_core_s
{ \
switch_io_event_hook_##_NAME##_t *hook, *ptr; \
assert(_NAME != NULL); \
for (ptr = session->event_hooks._NAME; ptr && ptr->next; ptr = ptr->next) \
if (ptr->_NAME == _NAME) return SWITCH_STATUS_FALSE; \
if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) { \
hook->_NAME = _NAME ; \
if (! session->event_hooks._NAME ) { \
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论