add tests and fix leak
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Thu, 24 May 2007 15:37:00 +0200
changeset 689 49bccd847179
parent 687 36e034af3dc1
child 690 48cf425136d6
add tests and fix leak
src/core/ptr.cc
src/core/ptr.h
--- a/src/core/ptr.cc	Thu May 24 15:23:11 2007 +0200
+++ b/src/core/ptr.cc	Thu May 24 15:37:00 2007 +0200
@@ -284,10 +284,12 @@
   {
     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
--- a/src/core/ptr.h	Thu May 24 15:23:11 2007 +0200
+++ b/src/core/ptr.h	Thu May 24 15:37:00 2007 +0200
@@ -179,11 +179,12 @@
 {
   static T & GetReference (Ptr<T> const p)
   {
-    return *GetPointer (p);
+    return *PeekPointer (p);
   }
 };
 
 
+
 } // namespace ns3