wait for bots to be disconnected on shutdown
[NeonServV5.git] / src / ClientSocket.c
index 7160014d36c18b089720ddf1e05f74743f4f9724..eb11d88fc131558ff1bb698f883c37bd91144188 100644 (file)
@@ -14,7 +14,7 @@
  * You should have received a copy of the GNU General Public License 
  * along with this program. If not, see <http://www.gnu.org/licenses/>. 
  */
-
+#include "main.h"
 #include "ClientSocket.h"
 #include "IRCParser.h"
 #include "UserNode.h"
@@ -222,6 +222,8 @@ static IOHANDLER_CALLBACK(socket_callback) {
     #ifdef HAVE_THREADS
     unsigned int tid;
     #endif
+    if(process_state.running == 0)
+        return; //just ignore the event (shutdown sequence)
     switch(event->type) {
     case IOEVENT_CONNECTED:
         client->flags |= SOCKET_FLAG_CONNECTED;