don't dereference potentially NULL m_sock in Disconnect()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45156 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-03-30 16:08:25 +00:00
parent ecb7235d76
commit 82c91ef51f

View File

@@ -381,8 +381,13 @@ bool wxTCPConnection::Disconnect ()
return true;
// Send the the disconnect message to the peer.
m_codeco->Write8(IPC_DISCONNECT);
m_sock->Notify(false);
m_sock->Close();
if ( m_sock )
{
m_sock->Notify(false);
m_sock->Close();
}
SetConnected(false);
return true;