fixed memory leak

This commit is contained in:
orignal 2015-02-07 17:58:29 -05:00
parent ab0bd908ec
commit a80e4ef0ea
4 changed files with 10 additions and 1 deletions

View File

@ -743,6 +743,8 @@ namespace util
s << endpoint.address ().to_string () << ":" << endpoint.port ();
if (!outgoing) s << "-->";
s << " [" << it.second->GetNumSentBytes () << ":" << it.second->GetNumReceivedBytes () << "]";
if (it.second->GetRelayTag ())
s << " [itag:" << it.second->GetRelayTag () << "]";
s << "<br>";
s << std::endl;
}

View File

@ -28,6 +28,11 @@ namespace transport
delete it.second;
}
void SSUData::Stop ()
{
m_ResendTimer.cancel ();
}
void SSUData::AdjustPacketSize (const i2p::data::RouterInfo& remoteRouter)
{
auto ssuAddress = remoteRouter.GetSSUAddress ();

View File

@ -78,7 +78,8 @@ namespace transport
SSUData (SSUSession& session);
~SSUData ();
void Stop ();
void ProcessMessage (uint8_t * buf, size_t len);
void Send (i2p::I2NPMessage * msg);

View File

@ -763,6 +763,7 @@ namespace transport
m_State = eSessionStateClosed;
SendSesionDestroyed ();
transports.PeerDisconnected (shared_from_this ());
m_Data.Stop ();
m_Timer.cancel ();
}