diff --git a/src/common/sckipc.cpp b/src/common/sckipc.cpp index 3b03e2de76..9922b0d04c 100644 --- a/src/common/sckipc.cpp +++ b/src/common/sckipc.cpp @@ -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;