Skip to content

Commit

Permalink
fixed memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Jul 5, 2014
1 parent 49035ef commit 73ef5e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions TunnelEndpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ namespace i2p
{
namespace tunnel
{
TunnelEndpoint::~TunnelEndpoint ()
{
for (auto it: m_IncompleteMessages)
i2p::DeleteI2NPMessage (it.second.data);
}

void TunnelEndpoint::HandleDecryptedTunnelDataMsg (I2NPMessage * msg)
{
m_NumReceivedBytes += TUNNEL_DATA_MSG_SIZE;
Expand Down
1 change: 1 addition & 0 deletions TunnelEndpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace tunnel
public:

TunnelEndpoint (): m_NumReceivedBytes (0) {};
~TunnelEndpoint ();
size_t GetNumReceivedBytes () const { return m_NumReceivedBytes; };

void HandleDecryptedTunnelDataMsg (I2NPMessage * msg);
Expand Down

0 comments on commit 73ef5e2

Please sign in to comment.