]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 15 Feb 2008 19:55:19 +0000 (19:55 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 15 Feb 2008 19:55:19 +0000 (19:55 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7625 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c

index 4ecd15e82e319a983e9e4c814d6da4fec15288a2..5896b66b81eac18e1bd4b238ff7c81e1139659d2 100644 (file)
@@ -248,13 +248,22 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_event_multicast_shutdown)
 {
        int x = 0;
 
-       switch_socket_shutdown(globals.udp_socket, SWITCH_SHUTDOWN_READWRITE);
-       globals.running = -1;
-       while (x < 100000 && globals.running) {
-               x++;
-               switch_yield(1000);
+       if (globals.udp_socket) {
+               switch_socket_shutdown(globals.udp_socket, SWITCH_SHUTDOWN_READWRITE);
+               switch_socket_close(globals.udp_socket);
+               globals.udp_socket = NULL;
+       }
+
+       if (globals.running == 1) {
+               globals.running = -1;
+               while (x < 100000 && globals.running) {
+                       x++;
+                       switch_yield(1000);
+               }
        }
+
        switch_core_hash_destroy(&globals.event_hash);
+
        return SWITCH_STATUS_SUCCESS;
 }