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:
@@ -381,8 +381,13 @@ bool wxTCPConnection::Disconnect ()
|
|||||||
return true;
|
return true;
|
||||||
// Send the the disconnect message to the peer.
|
// Send the the disconnect message to the peer.
|
||||||
m_codeco->Write8(IPC_DISCONNECT);
|
m_codeco->Write8(IPC_DISCONNECT);
|
||||||
m_sock->Notify(false);
|
|
||||||
m_sock->Close();
|
if ( m_sock )
|
||||||
|
{
|
||||||
|
m_sock->Notify(false);
|
||||||
|
m_sock->Close();
|
||||||
|
}
|
||||||
|
|
||||||
SetConnected(false);
|
SetConnected(false);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user