X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2f10f4238afa739b528d4115a5f2e8a0e87f2bcb..4f55a07f9f4c6ba6905aaa8e584e6fb14771d278:/src/common/socket.cpp?ds=sidebyside diff --git a/src/common/socket.cpp b/src/common/socket.cpp index c5b1bab4e4..7ec0743ec1 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -481,7 +481,7 @@ wxUint32 wxSocketBase::_Write(const void *buffer, wxUint32 nbytes) { bool more = TRUE; - while (more) + while (more) { if ( !(m_flags & wxSOCKET_BLOCK) && !WaitForWrite() ) break; @@ -1010,7 +1010,7 @@ wxUint32 wxSocketBase::GetPushback(void *buffer, wxUint32 size, bool peek) // ========================================================================== -// wxSocketServer +// wxSocketServer // ========================================================================== // -------------------------------------------------------------------------- @@ -1088,7 +1088,10 @@ wxSocketBase *wxSocketServer::Accept(bool wait) sock->SetFlags(m_flags); if (!AcceptWith(*sock, wait)) - return NULL; + { + sock->Destroy(); + sock = NULL; + } return sock; }