I wonder what the point of that code was: why should you test for zero _after_ using the pointer ? It needs to be tested _before_.

This commit is contained in:
Mathieu Lacage
2007-07-31 10:47:29 +02:00
parent 530b65e51d
commit 3d9d4ce7be

View File

@@ -73,12 +73,12 @@ UdpSocket::Destroy (void)
int
UdpSocket::FinishBind (void)
{
m_endPoint->SetRxCallback (MakeCallback (&UdpSocket::ForwardUp, this));
m_endPoint->SetDestroyCallback (MakeCallback (&UdpSocket::Destroy, this));
if (m_endPoint == 0)
{
return -1;
}
m_endPoint->SetRxCallback (MakeCallback (&UdpSocket::ForwardUp, this));
m_endPoint->SetDestroyCallback (MakeCallback (&UdpSocket::Destroy, this));
return 0;
}