]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/url.cpp
[ 1509599 ] 'Split pickers page in widgets sample' with more icons and rebaking.
[wxWidgets.git] / src / common / url.cpp
index 19944671c51a11b70a1fa08aed49116f6b9e62dd..14ebd7b851971f4524348072b4f872d3a75c1aca 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        url.cpp
+// Name:        src/common/url.cpp
 // Purpose:     URL parser
 // Author:      Guilhem Lavaux
 // Modified by:
@@ -9,25 +9,25 @@
 // 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"
+#endif
+
+#include "wx/module.h"
+
 #include <string.h>
 #include <ctype.h>
 
@@ -185,7 +185,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 +334,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 +377,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);