bug 133: automate RandomVariable memory management.

This commit is contained in:
Mathieu Lacage
2008-02-07 19:57:21 +01:00
parent bf9d59fe21
commit f03f1c237b
21 changed files with 1091 additions and 600 deletions

View File

@@ -59,9 +59,8 @@ void Application::Start(const Time& startTime)
void Application::Start(const RandomVariable& startVar)
{
RandomVariable *v = startVar.Copy ();
ScheduleStart (Seconds (v->GetValue ()));
delete v;
RandomVariable v = startVar;
ScheduleStart (Seconds (v.GetValue ()));
}
@@ -72,9 +71,8 @@ void Application::Stop(const Time& stopTime)
void Application::Stop(const RandomVariable& stopVar)
{
RandomVariable *v = stopVar.Copy ();
ScheduleStop (Seconds (v->GetValue ()));
delete v;
RandomVariable v = stopVar;
ScheduleStop (Seconds (v.GetValue ()));
}
Ptr<Node> Application::GetNode() const