Browse Source

break circular reference

pull/729/head
orignal 8 years ago
parent
commit
0e14b54b6d
  1. 15
      Destination.cpp
  2. 1
      Streaming.h

15
Destination.cpp

@ -700,13 +700,20 @@ namespace client @@ -700,13 +700,20 @@ namespace client
{
m_ReadyChecker.cancel();
m_StreamingDestination->Stop ();
m_StreamingDestination->SetOwner (nullptr);
m_StreamingDestination = nullptr;
for (auto& it: m_StreamingDestinationsByPorts)
{
it.second->Stop ();
if(m_DatagramDestination)
delete m_DatagramDestination;
m_DatagramDestination = nullptr;
return true;
it.second->SetOwner (nullptr);
}
m_StreamingDestinationsByPorts.clear ();
if (m_DatagramDestination)
{
delete m_DatagramDestination;
m_DatagramDestination = nullptr;
}
return true;
}
else
return false;

1
Streaming.h

@ -224,6 +224,7 @@ namespace stream @@ -224,6 +224,7 @@ namespace stream
void ResetAcceptor ();
bool IsAcceptorSet () const { return m_Acceptor != nullptr; };
std::shared_ptr<i2p::client::ClientDestination> GetOwner () const { return m_Owner; };
void SetOwner (std::shared_ptr<i2p::client::ClientDestination> owner) { m_Owner = owner; };
uint16_t GetLocalPort () const { return m_LocalPort; };
void HandleDataMessagePayload (const uint8_t * buf, size_t len);

Loading…
Cancel
Save