From 2c1c5afe9172ac858d8e1efafb41d482feaac09f Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Mon, 31 Mar 2008 14:43:38 -0700 Subject: [PATCH] get rid of channel during dispose --- src/node/simple-net-device.cc | 8 ++++++++ src/node/simple-net-device.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/node/simple-net-device.cc b/src/node/simple-net-device.cc index 43d57b643..82fda974d 100644 --- a/src/node/simple-net-device.cc +++ b/src/node/simple-net-device.cc @@ -153,6 +153,14 @@ SimpleNetDevice::SetReceiveCallback (NetDevice::ReceiveCallback cb) m_rxCallback = cb; } +void +SimpleNetDevice::DoDispose (void) +{ + m_channel = 0; + m_node = 0; + NetDevice::DoDispose (); +} + } // namespace ns3 diff --git a/src/node/simple-net-device.h b/src/node/simple-net-device.h index 76f3d6b82..ddb85694a 100644 --- a/src/node/simple-net-device.h +++ b/src/node/simple-net-device.h @@ -44,6 +44,8 @@ public: virtual bool NeedsArp (void) const; virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb); +protected: + virtual void DoDispose (void); private: Ptr m_channel; NetDevice::ReceiveCallback m_rxCallback;