X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8913c40c32bf45df97280c5b1e5a542bfc764ca8..e93523680ba3c83cdae75b511214c82f28a2d853:/src/common/sckipc.cpp 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;