diff --git a/examples/simple-p2p.cc b/examples/simple-p2p.cc index 2ec17cf80..43dfb5303 100644 --- a/examples/simple-p2p.cc +++ b/examples/simple-p2p.cc @@ -184,11 +184,11 @@ int main (int argc, char *argv[]) ipv4->SetDefaultRoute (Ipv4Address ("10.1.3.1"), 1); ipv4->Unref (); - n0->Unref (); - n1->Unref (); - n2->Unref (); - n3->Unref (); - + n0 = 0; + n1 = 0; + n2 = 0; + n3 = 0; + // Configure tracing of all enqueue, dequeue, and NetDevice receive events // Trace output will be sent to the simple-p2p.tr file AsciiTrace asciitrace ("simple-p2p.tr"); diff --git a/src/applications/application.cc b/src/applications/application.cc index 9379c87e4..6c62fe5ba 100644 --- a/src/applications/application.cc +++ b/src/applications/application.cc @@ -39,7 +39,6 @@ Application::Application(Ptr n) m_startVar(0), m_stopVar(0), m_start(false), m_stop(false) { - m_node->Ref (); } Application::Application(const Application& o) @@ -47,7 +46,6 @@ Application::Application(const Application& o) m_start(false), m_stop(false) { // Copy constructor m_node = o.m_node; - m_node->Ref (); // Copy the start and stop random variables if they exist if (o.m_startVar) m_startVar = o.m_startVar->Copy(); if (o.m_stopVar) m_stopVar = o.m_stopVar->Copy(); @@ -65,7 +63,6 @@ Application::DoDispose (void) { if (m_node != 0) { - m_node->Unref (); m_node = 0; } if (m_start) @@ -87,10 +84,7 @@ Application::DoDispose (void) Application& Application::operator=(const Application& rhs) { if (this == &rhs) return *this; // Self assignment - m_node->Unref (); - m_node = 0; m_node = rhs.m_node; - m_node->Ref (); delete m_startVar; m_startVar = 0; @@ -149,12 +143,7 @@ void Application::Stop(const RandomVariable& stopVar) // an application to a node. void Application::SetNode(Ptr n) { - if (m_node != 0) - { - m_node->Unref (); - } m_node = n; - m_node->Ref (); } Ptr Application::PeekNode() const diff --git a/src/node/net-device.cc b/src/node/net-device.cc index 401fb2a52..1f626d0f5 100644 --- a/src/node/net-device.cc +++ b/src/node/net-device.cc @@ -40,12 +40,10 @@ NetDevice::NetDevice(Ptr node, const MacAddress& addr) : m_isMulticast (false), m_isPointToPoint (false) { - m_node->Ref (); } NetDevice::~NetDevice () { - m_node->Unref (); m_node = 0; }