mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-27 12:56:15 +00:00
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
This commit is contained in:
parent
130d3f3828
commit
d2a2be5d6a
@ -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; \
|
switch_io_event_hook_##_NAME##_t *hook, *ptr; \
|
||||||
assert(_NAME != NULL); \
|
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) { \
|
if ((hook = switch_core_session_alloc(session, sizeof(*hook))) != 0) { \
|
||||||
hook->_NAME = _NAME ; \
|
hook->_NAME = _NAME ; \
|
||||||
if (! session->event_hooks._NAME ) { \
|
if (! session->event_hooks._NAME ) { \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user