--- a/src/internet-node/l3-demux.cc Thu May 10 07:43:52 2007 +0200
+++ b/src/internet-node/l3-demux.cc Thu May 10 07:44:18 2007 +0200
@@ -31,12 +31,10 @@
const Iid L3Demux::iid ("L3Demux");
-L3Demux::L3Demux (Node *node)
+L3Demux::L3Demux (Ptr<Node> node)
: NsUnknown (L3Demux::iid),
m_node (node)
-{
- m_node->Ref ();
-}
+{}
L3Demux::~L3Demux()
{}
@@ -50,11 +48,7 @@
i->second->Unref ();
}
m_protocols.clear ();
- if (m_node != 0)
- {
- m_node->Unref ();
- m_node = 0;
- }
+ m_node = 0;
NsUnknown::DoDispose ();
}
--- a/src/internet-node/l3-demux.h Thu May 10 07:43:52 2007 +0200
+++ b/src/internet-node/l3-demux.h Thu May 10 07:44:18 2007 +0200
@@ -29,6 +29,7 @@
#include <map>
#include "ns3/ns-unknown.h"
+#include "ns3/ptr.h"
namespace ns3 {
@@ -45,7 +46,7 @@
public:
static const Iid iid;
typedef int ProtocolTraceType;
- L3Demux(Node *node);
+ L3Demux(Ptr<Node> node);
virtual ~L3Demux();
/**
@@ -90,7 +91,7 @@
private:
typedef std::map<int, ns3::L3Protocol*> L3Map_t;
- Node *m_node;
+ Ptr<Node> m_node;
L3Map_t m_protocols;
};