fixed memory leak in wxHTTP
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13336 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -68,6 +68,7 @@ wxBase:
|
|||||||
- fixes to the command line parsing error and usage messages
|
- fixes to the command line parsing error and usage messages
|
||||||
- modified wxFileName::CreateTempFileName() to open the file atomically
|
- modified wxFileName::CreateTempFileName() to open the file atomically
|
||||||
(if possible) and, especially, not to leak the file descriptors under Unix
|
(if possible) and, especially, not to leak the file descriptors under Unix
|
||||||
|
- memory leak in wxHTTP fixed (Dimitri)
|
||||||
|
|
||||||
All (GUI):
|
All (GUI):
|
||||||
|
|
||||||
@@ -82,6 +83,7 @@ wxMSW:
|
|||||||
- fixed redraw problems in dynamically resized wxStaticText
|
- fixed redraw problems in dynamically resized wxStaticText
|
||||||
- fixed wxProgressDialog for ranges > 65535
|
- fixed wxProgressDialog for ranges > 65535
|
||||||
- wxFontEnumerator now returns all fonts, not only TrueType ones
|
- wxFontEnumerator now returns all fonts, not only TrueType ones
|
||||||
|
- wxTextCtrl with wxTE_RICH flag scrolls to the end when text is appended to it
|
||||||
|
|
||||||
2.3.2
|
2.3.2
|
||||||
-----
|
-----
|
||||||
|
@@ -50,6 +50,9 @@ protected:
|
|||||||
bool BuildRequest(const wxString& path, wxHTTP_Req req);
|
bool BuildRequest(const wxString& path, wxHTTP_Req req);
|
||||||
void SendHeaders();
|
void SendHeaders();
|
||||||
bool ParseHeaders();
|
bool ParseHeaders();
|
||||||
|
|
||||||
|
// deletes the header value strings
|
||||||
|
void ClearHeaders();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // wxUSE_PROTOCOL_HTTP
|
#endif // wxUSE_PROTOCOL_HTTP
|
||||||
|
@@ -49,6 +49,13 @@ wxHTTP::wxHTTP()
|
|||||||
}
|
}
|
||||||
|
|
||||||
wxHTTP::~wxHTTP()
|
wxHTTP::~wxHTTP()
|
||||||
|
{
|
||||||
|
ClearHeaders();
|
||||||
|
|
||||||
|
delete m_addr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxHTTP::ClearHeaders()
|
||||||
{
|
{
|
||||||
// wxString isn't a wxObject
|
// wxString isn't a wxObject
|
||||||
wxNode *node = m_headers.First();
|
wxNode *node = m_headers.First();
|
||||||
@@ -60,10 +67,7 @@ wxHTTP::~wxHTTP()
|
|||||||
node = node->Next();
|
node = node->Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_addr) {
|
m_headers.Clear();
|
||||||
delete m_addr;
|
|
||||||
m_addr = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxHTTP::GetContentType()
|
wxString wxHTTP::GetContentType()
|
||||||
@@ -79,7 +83,7 @@ void wxHTTP::SetProxyMode(bool on)
|
|||||||
void wxHTTP::SetHeader(const wxString& header, const wxString& h_data)
|
void wxHTTP::SetHeader(const wxString& header, const wxString& h_data)
|
||||||
{
|
{
|
||||||
if (m_read) {
|
if (m_read) {
|
||||||
m_headers.Clear();
|
ClearHeaders();
|
||||||
m_read = FALSE;
|
m_read = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,7 +134,7 @@ bool wxHTTP::ParseHeaders()
|
|||||||
wxString line;
|
wxString line;
|
||||||
wxStringTokenizer tokenzr;
|
wxStringTokenizer tokenzr;
|
||||||
|
|
||||||
m_headers.Clear();
|
ClearHeaders();
|
||||||
m_read = TRUE;
|
m_read = TRUE;
|
||||||
|
|
||||||
#if defined(__VISAGECPP__)
|
#if defined(__VISAGECPP__)
|
||||||
|
Reference in New Issue
Block a user