can you seg me now?

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7629 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-02-15 20:33:16 +00:00
parent 65f64abfa9
commit 345d5c79ba
1 changed files with 11 additions and 4 deletions

View File

@ -145,14 +145,18 @@ static void event_handler(switch_event_t *event)
size_t len; size_t len;
uint8_t send = 0; uint8_t send = 0;
buf = (char *) malloc(MULTICAST_BUFFSIZE); if (globals.running != 1) {
switch_assert(buf); return;
}
if (event->subclass && !strcmp(event->subclass->name, MULTICAST_EVENT)) { if (event->subclass && !strcmp(event->subclass->name, MULTICAST_EVENT)) {
/* ignore our own events to avoid ping pong */ /* ignore our own events to avoid ping pong */
return; return;
} }
buf = (char *) malloc(MULTICAST_BUFFSIZE);
switch_assert(buf);
if (globals.event_list[(uint8_t) SWITCH_EVENT_ALL]) { if (globals.event_list[(uint8_t) SWITCH_EVENT_ALL]) {
send = 1; send = 1;
} else if ((globals.event_list[(uint8_t) event->event_id])) { } else if ((globals.event_list[(uint8_t) event->event_id])) {
@ -250,8 +254,6 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_multicast_shutdown)
if (globals.udp_socket) { if (globals.udp_socket) {
switch_socket_shutdown(globals.udp_socket, SWITCH_SHUTDOWN_READWRITE); switch_socket_shutdown(globals.udp_socket, SWITCH_SHUTDOWN_READWRITE);
switch_socket_close(globals.udp_socket);
globals.udp_socket = NULL;
} }
if (globals.running == 1) { if (globals.running == 1) {
@ -262,6 +264,11 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_multicast_shutdown)
} }
} }
if (globals.udp_socket) {
switch_socket_close(globals.udp_socket);
globals.udp_socket = NULL;
}
switch_core_hash_destroy(&globals.event_hash); switch_core_hash_destroy(&globals.event_hash);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;