Browse Source

delete all streams upon deletion of a local destination

pull/102/head
orignal 10 years ago
parent
commit
ec624c89b2
  1. 1
      HTTPServer.cpp
  2. 4
      SAM.cpp
  3. 4
      Streaming.cpp

1
HTTPServer.cpp

@ -505,6 +505,7 @@ namespace util
{ {
m_Stream->Close (); m_Stream->Close ();
DeleteStream (m_Stream); DeleteStream (m_Stream);
m_Stream = nullptr;
} }
m_Socket->close (); m_Socket->close ();
delete this; delete this;

4
SAM.cpp

@ -18,7 +18,7 @@ namespace stream
if (m_Stream) if (m_Stream)
{ {
m_Stream->Close (); m_Stream->Close ();
delete m_Stream; DeleteStream (m_Stream);
} }
} }
@ -27,7 +27,7 @@ namespace stream
if (m_Stream) if (m_Stream)
{ {
m_Stream->Close (); m_Stream->Close ();
delete m_Stream; DeleteStream (m_Stream);
m_Stream = nullptr; m_Stream = nullptr;
} }
delete this; delete this;

4
Streaming.cpp

@ -38,6 +38,7 @@ namespace stream
Stream::~Stream () Stream::~Stream ()
{ {
Close ();
m_ReceiveTimer.cancel (); m_ReceiveTimer.cancel ();
m_ResendTimer.cancel (); m_ResendTimer.cancel ();
while (!m_ReceiveQueue.empty ()) while (!m_ReceiveQueue.empty ())
@ -561,7 +562,8 @@ namespace stream
StreamingDestination::~StreamingDestination () StreamingDestination::~StreamingDestination ()
{ {
// TODO: delete streams for (auto it: m_Streams)
delete it.second;
if (m_Pool) if (m_Pool)
i2p::tunnel::tunnels.DeleteTunnelPool (m_Pool); i2p::tunnel::tunnels.DeleteTunnelPool (m_Pool);
delete m_LeaseSet; delete m_LeaseSet;

Loading…
Cancel
Save