From a6e2a3fc309d19e0e50ddfa38883c7fd21e01bf3 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Wed, 2 May 2007 11:43:22 +0200 Subject: [PATCH] do not leak the channel from simple-p2p --- examples/simple-p2p.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/examples/simple-p2p.cc b/examples/simple-p2p.cc index 00dc4d865..682f03e4d 100644 --- a/examples/simple-p2p.cc +++ b/examples/simple-p2p.cc @@ -104,20 +104,26 @@ int main (int argc, char *argv[]) Node* n2 = Node::Create(); Node* n3 = Node::Create(); - PointToPointTopology::AddPointToPointLink ( + PointToPointChannel *channel0 = + PointToPointTopology::AddPointToPointLink ( n0, Ipv4Address("10.1.1.1"), n2, Ipv4Address("10.1.1.2"), DataRate(5000000), MilliSeconds(2)); + channel0->Unref (); - PointToPointTopology::AddPointToPointLink ( + PointToPointChannel *channel1 = + PointToPointTopology::AddPointToPointLink ( n1, Ipv4Address("10.1.2.1"), n2, Ipv4Address("10.1.2.2"), DataRate(5000000), MilliSeconds(2)); + channel1->Unref (); - PointToPointTopology::AddPointToPointLink ( + PointToPointChannel *channel2 = + PointToPointTopology::AddPointToPointLink ( n2, Ipv4Address("10.1.3.1"), n3, Ipv4Address("10.1.3.2"), DataRate(1500000), MilliSeconds(10)); + channel2->Unref (); // Create the OnOff application to send UDP datagrams of size // 210 bytes at a rate of 448 Kb/s