mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-13 21:06:39 +01:00
fixed memory leak
This commit is contained in:
parent
bd13406f42
commit
9539fb8cb0
1 changed files with 9 additions and 4 deletions
|
@ -514,15 +514,17 @@ namespace util
|
|||
|
||||
void HTTPConnection::Terminate ()
|
||||
{
|
||||
if (!m_Stream || !m_Stream->IsOpen ()) return;
|
||||
if (m_Stream)
|
||||
if (!m_Stream) return;
|
||||
m_Socket->close ();
|
||||
if (m_Stream->IsOpen ())
|
||||
m_Stream->Close ();
|
||||
|
||||
m_Socket->close ();
|
||||
m_Socket->get_io_service ().post ([=](void)
|
||||
{
|
||||
i2p::stream::DeleteStream (m_Stream);
|
||||
//delete this;
|
||||
m_Stream.reset ();
|
||||
m_Stream = nullptr;
|
||||
// delete this
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -604,7 +606,10 @@ namespace util
|
|||
void HTTPConnection::HandleWriteReply (const boost::system::error_code& ecode)
|
||||
{
|
||||
if (ecode != boost::asio::error::operation_aborted)
|
||||
{
|
||||
m_Socket->close ();
|
||||
Terminate ();
|
||||
}
|
||||
}
|
||||
|
||||
void HTTPConnection::HandleWrite (const boost::system::error_code& ecode)
|
||||
|
|
Loading…
Add table
Reference in a new issue