add tests and fix leak

This commit is contained in:
Mathieu Lacage
2007-05-24 15:37:00 +02:00
parent df1cd3d5da
commit 01d21b3ea2
2 changed files with 4 additions and 1 deletions

View File

@@ -284,10 +284,12 @@ PtrTest::RunTests (void)
{
Ptr<NoCount> p = MakeNewObject<NoCount> (cb);
Callback<void> callback = MakeCallback (&NoCount::Nothing, p);
callback ();
}
{
Ptr<const NoCount> p = MakeNewObject<NoCount> (cb);
Callback<void> callback = MakeCallback (&NoCount::Nothing, p);
callback ();
}
#if 0

View File

@@ -179,11 +179,12 @@ struct CallbackTraits<Ptr<T> >
{
static T & GetReference (Ptr<T> const p)
{
return *GetPointer (p);
return *PeekPointer (p);
}
};
} // namespace ns3