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