diff --git a/src/devices/bridge/bridge-channel.cc b/src/devices/bridge/bridge-channel.cc index 26ec993c9..7029c5251 100644 --- a/src/devices/bridge/bridge-channel.cc +++ b/src/devices/bridge/bridge-channel.cc @@ -44,8 +44,16 @@ BridgeChannel::BridgeChannel () BridgeChannel::~BridgeChannel () { NS_LOG_FUNCTION_NOARGS (); + + for (std::vector< Ptr >::iterator iter = m_bridgedChannels.begin (); + iter != m_bridgedChannels.end (); iter++) + { + *iter = 0; + } + m_bridgedChannels.clear (); } + void BridgeChannel::AddChannel (Ptr bridgedChannel) { diff --git a/src/devices/mesh/dot11s/peer-management-protocol.cc b/src/devices/mesh/dot11s/peer-management-protocol.cc index cff61506a..415fa8f69 100644 --- a/src/devices/mesh/dot11s/peer-management-protocol.cc +++ b/src/devices/mesh/dot11s/peer-management-protocol.cc @@ -71,6 +71,7 @@ PeerManagementProtocol::PeerManagementProtocol () : } PeerManagementProtocol::~PeerManagementProtocol () { + m_meshId = 0; } void PeerManagementProtocol::DoDispose () diff --git a/src/devices/mesh/mesh-l2-routing-protocol.cc b/src/devices/mesh/mesh-l2-routing-protocol.cc index e4f242fbf..176ea222c 100644 --- a/src/devices/mesh/mesh-l2-routing-protocol.cc +++ b/src/devices/mesh/mesh-l2-routing-protocol.cc @@ -39,6 +39,7 @@ MeshL2RoutingProtocol::GetTypeId (void) MeshL2RoutingProtocol::~MeshL2RoutingProtocol () { + m_mp = 0; } void diff --git a/src/devices/mesh/mesh-wifi-interface-mac.cc b/src/devices/mesh/mesh-wifi-interface-mac.cc index de97fd912..247947318 100644 --- a/src/devices/mesh/mesh-wifi-interface-mac.cc +++ b/src/devices/mesh/mesh-wifi-interface-mac.cc @@ -109,6 +109,10 @@ MeshWifiInterfaceMac::MeshWifiInterfaceMac () MeshWifiInterfaceMac::~MeshWifiInterfaceMac () { NS_LOG_FUNCTION (this); + m_beaconDca = 0; + m_stationManager = 0; + m_phy = 0; + m_low = 0; } //----------------------------------------------------------------------------- // WifiMac inherited diff --git a/src/devices/mesh/wifi-information-element-vector.cc b/src/devices/mesh/wifi-information-element-vector.cc index f44e0e646..9c3dbb641 100644 --- a/src/devices/mesh/wifi-information-element-vector.cc +++ b/src/devices/mesh/wifi-information-element-vector.cc @@ -48,6 +48,11 @@ WifiInformationElementVector::WifiInformationElementVector () : } WifiInformationElementVector::~WifiInformationElementVector () { + for (IE_VECTOR::iterator i = m_elements.begin (); i != m_elements.end (); i++) + { + *i = 0; + } + m_elements.clear (); } TypeId WifiInformationElementVector::GetTypeId () diff --git a/src/devices/wifi/interference-helper.cc b/src/devices/wifi/interference-helper.cc index 221dad65b..b85183f1d 100644 --- a/src/devices/wifi/interference-helper.cc +++ b/src/devices/wifi/interference-helper.cc @@ -128,6 +128,7 @@ InterferenceHelper::InterferenceHelper () {} InterferenceHelper::~InterferenceHelper () { + EraseEvents (); m_errorRateModel = 0; } diff --git a/src/helper/mesh-helper.cc b/src/helper/mesh-helper.cc index 876afb00f..2c4aa7a5d 100644 --- a/src/helper/mesh-helper.cc +++ b/src/helper/mesh-helper.cc @@ -32,6 +32,10 @@ MeshHelper::MeshHelper () : m_standard (WIFI_PHY_STANDARD_80211a) { } +MeshHelper::~MeshHelper () +{ + m_stack = 0; +} void MeshHelper::SetSpreadInterfaceChannels (enum ChannelPolicy policy) { diff --git a/src/helper/mesh-helper.h b/src/helper/mesh-helper.h index 1a343988b..31aca274e 100644 --- a/src/helper/mesh-helper.h +++ b/src/helper/mesh-helper.h @@ -43,6 +43,11 @@ public: */ MeshHelper (); + /** + * Destroy a MeshHelper. + */ + ~MeshHelper (); + /** * \brief Set the helper to the default values for the MAC type, remote * station manager and channel policy.