From 9e3dfb3863c183c3819facc113e953ef154fcd0e Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Wed, 18 Jul 2012 10:45:01 +0000 Subject: SocketThreads: hopefully fixed MacOSX failure with client ping crashing the server git-svn-id: http://mc-server.googlecode.com/svn/trunk@681 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cSocketThreads.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/cSocketThreads.cpp b/source/cSocketThreads.cpp index b27523972..594d5a7d7 100644 --- a/source/cSocketThreads.cpp +++ b/source/cSocketThreads.cpp @@ -640,7 +640,8 @@ void cSocketThreads::cSocketThread::WriteToSockets(fd_set * a_Write) cCSLock Lock(m_Parent->m_CS); for (int i = m_NumSlots - 1; i >= 0; --i) { - if (!FD_ISSET(m_Slots[i].m_Socket->GetSocket(), a_Write)) + cSocket Socket(*(m_Slots[i].m_Socket)); + if (!Socket.IsValid() || !FD_ISSET(Socket.GetSocket(), a_Write)) { continue; } -- cgit v1.2.3