dispose the channel from WifiNetDevice
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu, 18 Oct 2007 11:50:35 +0200
changeset 1998 41cd4e5694c2
parent 1997 9eb577e60987
child 1999 9c279e6ebb20
dispose the channel from WifiNetDevice
src/devices/wifi/wifi-net-device.cc
src/devices/wifi/wifi-net-device.h
--- a/src/devices/wifi/wifi-net-device.cc	Thu Oct 18 11:25:33 2007 +0200
+++ b/src/devices/wifi/wifi-net-device.cc	Thu Oct 18 11:50:35 2007 +0200
@@ -216,6 +216,14 @@
 {
   return m_channel;
 }
+void 
+WifiNetDevice::DoDispose (void)
+{
+  // chain up.
+  NetDevice::DoDispose ();
+  // cleanup local
+  m_channel = 0;
+}
 
 
 /*****************************************************
--- a/src/devices/wifi/wifi-net-device.h	Thu Oct 18 11:25:33 2007 +0200
+++ b/src/devices/wifi/wifi-net-device.h	Thu Oct 18 11:50:35 2007 +0200
@@ -70,6 +70,7 @@
 protected:
   WifiNetDevice (Ptr<Node> node);
   void DoForwardUp (Packet packet, const Mac48Address &from);
+  virtual void DoDispose (void);
   DcaTxop *CreateDca (uint32_t minCw, uint32_t maxCw) const;
 
   Ptr<WifiChannel> m_channel;