X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8913c40c32bf45df97280c5b1e5a542bfc764ca8..0bd2681966523df88ad5cf8e505b532843e58d74:/src/common/sckipc.cpp diff --git a/src/common/sckipc.cpp b/src/common/sckipc.cpp index 3b03e2de76..350b824257 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; @@ -438,7 +443,7 @@ wxChar *wxTCPConnection::Request (const wxString& item, int *size, wxIPCFormat f } } -bool wxTCPConnection::Poke (const wxString& item, wxChar *data, int size, wxIPCFormat format) +bool wxTCPConnection::Poke (const wxString& item, const wxChar *data, int size, wxIPCFormat format) { if (!m_sock->IsConnected()) return false; @@ -494,7 +499,7 @@ bool wxTCPConnection::StopAdvise (const wxString& item) // Calls that SERVER can make bool wxTCPConnection::Advise (const wxString& item, - wxChar *data, int size, wxIPCFormat format) + const wxChar *data, int size, wxIPCFormat format) { if (!m_sock->IsConnected()) return false; @@ -643,7 +648,7 @@ void wxTCPEventHandler::Client_OnRequest(wxSocketEvent &event) format = (wxIPCFormat)codeci->Read8(); int user_size = -1; - wxChar *user_data = connection->OnRequest (topic_name, item, &user_size, format); + const wxChar *user_data = connection->OnRequest (topic_name, item, &user_size, format); if (user_data) {