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:
@@ -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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user