X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd725bce37986e9d2d8b8324b47f5ed573f2d636..69659fd770f615210efac4b4fa741b3ad6223616:/src/common/url.cpp?ds=sidebyside diff --git a/src/common/url.cpp b/src/common/url.cpp index cf3272ef22..7c6ae67075 100644 --- a/src/common/url.cpp +++ b/src/common/url.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: url.cpp +// Name: src/common/url.cpp // Purpose: URL parser // Author: Guilhem Lavaux // Modified by: @@ -9,25 +9,24 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "url.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #if wxUSE_URL -#include "wx/string.h" -#include "wx/list.h" -#include "wx/utils.h" -#include "wx/module.h" #include "wx/url.h" +#ifndef WX_PRECOMP + #include "wx/list.h" + #include "wx/string.h" + #include "wx/utils.h" + #include "wx/module.h" +#endif + #include #include @@ -185,7 +184,9 @@ void wxURL::CleanData() #if wxUSE_PROTOCOL_HTTP if (!m_useProxy) #endif // wxUSE_PROTOCOL_HTTP - delete m_protocol; + if (m_protocol) + // Need to safely delete the socket (pending events) + m_protocol->Destroy(); } wxURL::~wxURL() @@ -332,7 +333,7 @@ void wxURL::SetDefaultProxy(const wxString& url_proxy) return; wxString hostname = tmp_str(0, pos), - port = tmp_str(pos+1, tmp_str.Length()-pos); + port = tmp_str(pos+1, tmp_str.length()-pos); wxIPV4address addr; if (!addr.Hostname(hostname)) @@ -375,7 +376,7 @@ void wxURL::SetProxy(const wxString& url_proxy) return; hostname = tmp_str(0, pos); - port = tmp_str(pos+1, tmp_str.Length()-pos); + port = tmp_str(pos+1, tmp_str.length()-pos); addr.Hostname(hostname); addr.Service(port); @@ -440,4 +441,5 @@ void wxURLModule::OnExit() #endif // wxUSE_SOCKETS + #endif // wxUSE_URL