[Freeswitch-svn] [commit] r13111 - freeswitch/trunk/src/include

FreeSWITCH SVN anthm at freeswitch.org
Tue Apr 21 15:51:28 PDT 2009


Author: anthm
Date: Tue Apr 21 17:51:28 2009
New Revision: 13111

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

Modified:
   freeswitch/trunk/src/include/switch_core_event_hook.h

Modified: freeswitch/trunk/src/include/switch_core_event_hook.h
==============================================================================
--- freeswitch/trunk/src/include/switch_core_event_hook.h	(original)
+++ freeswitch/trunk/src/include/switch_core_event_hook.h	Tue Apr 21 17:51:28 2009
@@ -181,6 +181,8 @@
 	{																	\
 		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 ) {						\



More information about the Freeswitch-svn mailing list