projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
don't return success when converting incomplete UTF-7 sequences
[wxWidgets.git]
/
src
/
common
/
url.cpp
diff --git
a/src/common/url.cpp
b/src/common/url.cpp
index cf3272ef225262d6dfcc087daefcdcb85e3a706f..b48d5dabe71b189f00f05f3912ea9a7aaa9a5d77 100644
(file)
--- 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:
// Purpose: URL parser
// Author: Guilhem Lavaux
// Modified by:
@@
-9,25
+9,24
@@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// 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__
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
-#pragma hdrstop
+
#pragma hdrstop
#endif
#if wxUSE_URL
#endif
#if wxUSE_URL
-#include "wx/string.h"
-#include "wx/list.h"
-#include "wx/utils.h"
-#include "wx/module.h"
#include "wx/url.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 <string.h>
#include <ctype.h>
#include <string.h>
#include <ctype.h>
@@
-185,7
+184,9
@@
void wxURL::CleanData()
#if wxUSE_PROTOCOL_HTTP
if (!m_useProxy)
#endif // wxUSE_PROTOCOL_HTTP
#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()
}
wxURL::~wxURL()
@@
-332,7
+333,7
@@
void wxURL::SetDefaultProxy(const wxString& url_proxy)
return;
wxString hostname = tmp_str(0, pos),
return;
wxString hostname = tmp_str(0, pos),
- port = tmp_str(pos+1, tmp_str.
L
ength()-pos);
+ port = tmp_str(pos+1, tmp_str.
l
ength()-pos);
wxIPV4address addr;
if (!addr.Hostname(hostname))
wxIPV4address addr;
if (!addr.Hostname(hostname))
@@
-375,7
+376,7
@@
void wxURL::SetProxy(const wxString& url_proxy)
return;
hostname = tmp_str(0, pos);
return;
hostname = tmp_str(0, pos);
- port = tmp_str(pos+1, tmp_str.
L
ength()-pos);
+ port = tmp_str(pos+1, tmp_str.
l
ength()-pos);
addr.Hostname(hostname);
addr.Service(port);
addr.Hostname(hostname);
addr.Service(port);
@@
-405,6
+406,8
@@
void wxURL::SetProxy(const wxString& url_proxy)
class wxURLModule : public wxModule
{
public:
class wxURLModule : public wxModule
{
public:
+ wxURLModule();
+
virtual bool OnInit();
virtual void OnExit();
virtual bool OnInit();
virtual void OnExit();
@@
-414,6
+417,13
@@
private:
IMPLEMENT_DYNAMIC_CLASS(wxURLModule, wxModule)
IMPLEMENT_DYNAMIC_CLASS(wxURLModule, wxModule)
+wxURLModule::wxURLModule()
+{
+ // we must be cleaned up before wxSocketModule as otherwise deleting
+ // ms_proxyDefault from our OnExit() won't work (and can actually crash)
+ AddDependency(wxClassInfo::FindClass(_T("wxSocketModule")));
+}
+
bool wxURLModule::OnInit()
{
#if wxUSE_PROTOCOL_HTTP
bool wxURLModule::OnInit()
{
#if wxUSE_PROTOCOL_HTTP
@@
-440,4
+450,5
@@
void wxURLModule::OnExit()
#endif // wxUSE_SOCKETS
#endif // wxUSE_SOCKETS
+
#endif // wxUSE_URL
#endif // wxUSE_URL