plug leaks (bug 711) ns-3.6-RC2
authorCraig Dowell <craigdo@ee.washington.edu>
Tue, 13 Oct 2009 22:41:30 -0700
changeset 5417899604299046
parent 5416 9800d5479341
child 5418 e2b7e37a146a
plug leaks (bug 711)
src/devices/bridge/bridge-channel.cc
src/devices/mesh/dot11s/peer-management-protocol.cc
src/devices/mesh/mesh-l2-routing-protocol.cc
src/devices/mesh/mesh-wifi-interface-mac.cc
src/devices/mesh/wifi-information-element-vector.cc
src/devices/wifi/interference-helper.cc
src/helper/mesh-helper.cc
src/helper/mesh-helper.h
     1.1 --- a/src/devices/bridge/bridge-channel.cc	Tue Oct 13 12:51:46 2009 -0700
     1.2 +++ b/src/devices/bridge/bridge-channel.cc	Tue Oct 13 22:41:30 2009 -0700
     1.3 @@ -44,8 +44,16 @@
     1.4  BridgeChannel::~BridgeChannel ()
     1.5  {
     1.6    NS_LOG_FUNCTION_NOARGS ();
     1.7 +
     1.8 +  for (std::vector< Ptr<Channel> >::iterator iter = m_bridgedChannels.begin ();
     1.9 +       iter != m_bridgedChannels.end (); iter++)
    1.10 +    {
    1.11 +      *iter = 0;
    1.12 +    }
    1.13 +  m_bridgedChannels.clear ();
    1.14  }
    1.15  
    1.16 +
    1.17  void
    1.18  BridgeChannel::AddChannel (Ptr<Channel> bridgedChannel)
    1.19  {
     2.1 --- a/src/devices/mesh/dot11s/peer-management-protocol.cc	Tue Oct 13 12:51:46 2009 -0700
     2.2 +++ b/src/devices/mesh/dot11s/peer-management-protocol.cc	Tue Oct 13 22:41:30 2009 -0700
     2.3 @@ -71,6 +71,7 @@
     2.4  }
     2.5  PeerManagementProtocol::~PeerManagementProtocol ()
     2.6  {
     2.7 +  m_meshId = 0;
     2.8  }
     2.9  void
    2.10  PeerManagementProtocol::DoDispose ()
     3.1 --- a/src/devices/mesh/mesh-l2-routing-protocol.cc	Tue Oct 13 12:51:46 2009 -0700
     3.2 +++ b/src/devices/mesh/mesh-l2-routing-protocol.cc	Tue Oct 13 22:41:30 2009 -0700
     3.3 @@ -39,6 +39,7 @@
     3.4  
     3.5  MeshL2RoutingProtocol::~MeshL2RoutingProtocol ()
     3.6  {
     3.7 +  m_mp = 0;
     3.8  }
     3.9  
    3.10  void
     4.1 --- a/src/devices/mesh/mesh-wifi-interface-mac.cc	Tue Oct 13 12:51:46 2009 -0700
     4.2 +++ b/src/devices/mesh/mesh-wifi-interface-mac.cc	Tue Oct 13 22:41:30 2009 -0700
     4.3 @@ -109,6 +109,10 @@
     4.4  MeshWifiInterfaceMac::~MeshWifiInterfaceMac ()
     4.5  {
     4.6    NS_LOG_FUNCTION (this);
     4.7 +  m_beaconDca = 0;
     4.8 +  m_stationManager = 0;
     4.9 +  m_phy = 0;
    4.10 +  m_low = 0;
    4.11  }
    4.12  //-----------------------------------------------------------------------------
    4.13  // WifiMac inherited
     5.1 --- a/src/devices/mesh/wifi-information-element-vector.cc	Tue Oct 13 12:51:46 2009 -0700
     5.2 +++ b/src/devices/mesh/wifi-information-element-vector.cc	Tue Oct 13 22:41:30 2009 -0700
     5.3 @@ -48,6 +48,11 @@
     5.4  }
     5.5  WifiInformationElementVector::~WifiInformationElementVector ()
     5.6  {
     5.7 +  for (IE_VECTOR::iterator i = m_elements.begin (); i != m_elements.end (); i++)
     5.8 +    {
     5.9 +      *i = 0;
    5.10 +    }
    5.11 +  m_elements.clear ();
    5.12  }
    5.13  TypeId
    5.14  WifiInformationElementVector::GetTypeId ()
     6.1 --- a/src/devices/wifi/interference-helper.cc	Tue Oct 13 12:51:46 2009 -0700
     6.2 +++ b/src/devices/wifi/interference-helper.cc	Tue Oct 13 22:41:30 2009 -0700
     6.3 @@ -128,6 +128,7 @@
     6.4  {}
     6.5  InterferenceHelper::~InterferenceHelper ()
     6.6  {
     6.7 +  EraseEvents ();
     6.8    m_errorRateModel = 0;
     6.9  }
    6.10  
     7.1 --- a/src/helper/mesh-helper.cc	Tue Oct 13 12:51:46 2009 -0700
     7.2 +++ b/src/helper/mesh-helper.cc	Tue Oct 13 22:41:30 2009 -0700
     7.3 @@ -32,6 +32,10 @@
     7.4    m_standard (WIFI_PHY_STANDARD_80211a)
     7.5  {
     7.6  }
     7.7 +MeshHelper::~MeshHelper ()
     7.8 +{
     7.9 +  m_stack = 0;
    7.10 +}
    7.11  void
    7.12  MeshHelper::SetSpreadInterfaceChannels (enum ChannelPolicy policy)
    7.13  {
     8.1 --- a/src/helper/mesh-helper.h	Tue Oct 13 12:51:46 2009 -0700
     8.2 +++ b/src/helper/mesh-helper.h	Tue Oct 13 22:41:30 2009 -0700
     8.3 @@ -44,6 +44,11 @@
     8.4    MeshHelper ();
     8.5  
     8.6    /**
     8.7 +   * Destroy a MeshHelper.
     8.8 +   */
     8.9 +  ~MeshHelper ();
    8.10 +
    8.11 +  /**
    8.12     * \brief Set the helper to the default values for the MAC type,  remote
    8.13     * station manager and channel policy.
    8.14     */