fixed memory leak in Accept()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9398 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-02-20 16:34:23 +00:00
parent 7e139aafe0
commit c3e646b47f

View File

@@ -481,7 +481,7 @@ wxUint32 wxSocketBase::_Write(const void *buffer, wxUint32 nbytes)
{ {
bool more = TRUE; bool more = TRUE;
while (more) while (more)
{ {
if ( !(m_flags & wxSOCKET_BLOCK) && !WaitForWrite() ) if ( !(m_flags & wxSOCKET_BLOCK) && !WaitForWrite() )
break; 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); sock->SetFlags(m_flags);
if (!AcceptWith(*sock, wait)) if (!AcceptWith(*sock, wait))
return NULL; {
sock->Destroy();
sock = NULL;
}
return sock; return sock;
} }