From 9ceaf6cec1da2c3111130b5fd016ca0fcced0fca Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Thu, 14 Mar 2013 19:46:31 +0000 Subject: [PATCH] - attempt to further protect threaded socket access --- source/shared_lib/sources/platform/posix/socket.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/shared_lib/sources/platform/posix/socket.cpp b/source/shared_lib/sources/platform/posix/socket.cpp index 087cf5bd..3510578b 100644 --- a/source/shared_lib/sources/platform/posix/socket.cpp +++ b/source/shared_lib/sources/platform/posix/socket.cpp @@ -1676,6 +1676,7 @@ bool Socket::isReadable(bool lockMutex) { safeMutex.setMutex(dataSynchAccessorRead,CODE_AT_LINE); } + if(isSocketValid() == false) return false; FD_SET(sock, &set); int i = 0; @@ -1723,6 +1724,7 @@ bool Socket::isWritable(struct timeval *timeVal, bool lockMutex) { if(lockMutex == true) { safeMutex.setMutex(dataSynchAccessorWrite,CODE_AT_LINE); } + if(isSocketValid() == false) return false; FD_SET(sock, &set); int i = 0;