From 767fceb6f09f98b58fdf2c7a840d2b40aea9e87e Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Wed, 2 May 2007 11:38:21 +0200 Subject: [PATCH] do not use Simulator::StopAt to avoid too many memory leaks --- examples/simple-p2p.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/simple-p2p.cc b/examples/simple-p2p.cc index 069117ed0..00dc4d865 100644 --- a/examples/simple-p2p.cc +++ b/examples/simple-p2p.cc @@ -133,6 +133,7 @@ int main (int argc, char *argv[]) n0->GetApplicationList()->Add(ooff0); // Start the application ooff0->Start(Seconds(1.0)); + ooff0->Stop (Seconds(10.0)); // Create a similar flow from n3 to n1, starting at time 1.1 seconds OnOffApplication* ooff1 = new OnOffApplication( @@ -147,6 +148,7 @@ int main (int argc, char *argv[]) n3->GetApplicationList()->Add(ooff1); // Start the application ooff1->Start(Seconds(1.1)); + ooff1->Stop (Seconds(10.0)); // Here, finish off packet routing configuration // This will likely set by some global StaticRouting object in the future @@ -164,8 +166,6 @@ int main (int argc, char *argv[]) trace.TraceAllIp (); #endif - Simulator::StopAt (Seconds(10.0)); - Simulator::Run (); n0->Dispose ();