From: Vadim Zeitlin Date: Fri, 30 Mar 2007 16:08:25 +0000 (+0000) Subject: don't dereference potentially NULL m_sock in Disconnect() X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/82c91ef51f3b098305d5d5710c68f1f0e5922215 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 --- 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;