From: Anthony Minessale Date: Tue, 21 Apr 2009 22:51:28 +0000 (+0000) Subject: make state_handler macros not let you install the same one more than once X-Git-Tag: v1.0.4~1086 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2a2be5d6a0ee041910b52d43a1a25f448e58d65;p=thirdparty%2Ffreeswitch.git 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 --- diff --git a/src/include/switch_core_event_hook.h b/src/include/switch_core_event_hook.h index ca78eadb36..20f7a1766d 100644 --- a/src/include/switch_core_event_hook.h +++ b/src/include/switch_core_event_hook.h @@ -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 ) { \