Don't leak m_protocol in wxURL.
Destroy the old protocol before creating it anew in ParseURL(). Closes #11796. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63730 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -166,6 +166,8 @@ bool wxURL::ParseURL()
|
||||
m_url = m_url + wxT("//") + m_server;
|
||||
|
||||
// We initialize specific variables.
|
||||
if (m_protocol)
|
||||
m_protocol->Destroy();
|
||||
m_protocol = m_proxy; // FIXME: we should clone the protocol
|
||||
}
|
||||
#endif // wxUSE_PROTOCOL_HTTP
|
||||
@@ -183,9 +185,14 @@ void wxURL::CleanData()
|
||||
#if wxUSE_PROTOCOL_HTTP
|
||||
if (!m_useProxy)
|
||||
#endif // wxUSE_PROTOCOL_HTTP
|
||||
{
|
||||
if (m_protocol)
|
||||
{
|
||||
// Need to safely delete the socket (pending events)
|
||||
m_protocol->Destroy();
|
||||
m_protocol = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wxURL::~wxURL()
|
||||
|
Reference in New Issue
Block a user