]> 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 65f2fe726511259b567b42855c4954a8af280092..14ebd7b851971f4524348072b4f872d3a75c1aca 100644 (file)
 
 #if wxUSE_URL
 
+#include "wx/url.h"
+
 #ifndef WX_PRECOMP
     #include "wx/list.h"
+    #include "wx/string.h"
+    #include "wx/utils.h"
 #endif
 
-#include "wx/string.h"
-#include "wx/utils.h"
 #include "wx/module.h"
-#include "wx/url.h"
 
 #include <string.h>
 #include <ctype.h>
@@ -184,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()