Adding several corrections. Most important is fixing regression in ccnb-parser-block.cc
diff --git a/model/ccnx-l3-protocol.cc b/model/ccnx-l3-protocol.cc
index 6a4fae6..823ddbe 100644
--- a/model/ccnx-l3-protocol.cc
+++ b/model/ccnx-l3-protocol.cc
@@ -131,6 +131,12 @@
}
m_faces.clear ();
m_node = 0;
+
+ // Force delete on objects
+ m_rit = 0;
+ m_pit = 0;
+ m_contentStore = 0;
+
// m_forwardingStrategy = 0;
Object::DoDispose ();
}
@@ -497,14 +503,14 @@
CcnxPitEntryIncomingFaceContainer::type::iterator inFace = pitEntry->m_incoming.find (incomingFace);
CcnxPitEntryOutgoingFaceContainer::type::iterator outFace = pitEntry->m_outgoing.find (incomingFace);
- NS_LOG_INFO("Before (pitEntry != m_pit->end()) && (pitEntry->m_timerExpired == false)");
+ NS_LOG_INFO("Before (pitEntry != m_pit->end()) && (pitEntry->m_timerExpired == false)");
if ((pitEntry != m_pit->end()) && (pitEntry->m_timerExpired == false))
{
NS_LOG_INFO("Entering (pitEntry != m_pit->end()) && (pitEntry->m_timerExpired == false)");
- if(inFace->m_face == NULL)
+ if(inFace->m_face == 0)
NS_LOG_INFO("in face is null");
- if(outFace->m_face == NULL)
+ if(outFace->m_face == 0)
NS_LOG_INFO("outface is null");
if(outFace == pitEntry->m_outgoing.end())
NS_LOG_INFO("OUTFACE = END");
diff --git a/model/ccnx-pit.cc b/model/ccnx-pit.cc
index 7e57b19..86484ef 100644
--- a/model/ccnx-pit.cc
+++ b/model/ccnx-pit.cc
@@ -28,28 +28,10 @@
namespace ns3 {
-// NS_OBJECT_ENSURE_REGISTERED (CcnxPit);
+NS_OBJECT_ENSURE_REGISTERED (CcnxPit);
using namespace __ccnx_private;
-// size_t
-// PitEntry::numberOfPromisingInterests(e_pi ) const
-// {
-// size_t count = 0;
-
-// BOOST_FOREACH (const CcnxPitOutgoingInterest &interest, m_outgoingInterests)
-// {
-// }
-// for( PitOutgoingConstIterator i = outgoingInterests.begin();
-// i!=outgoingInterests.end();
-// i++ )
-// {
-// if( !i->waitingInVain ) count++;
-// }
-
-// return count;
-// }
-
TypeId
CcnxPit::GetTypeId ()
{
@@ -71,6 +53,14 @@
{
}
+CcnxPit::~CcnxPit ()
+{
+ if (m_cleanupEvent.IsRunning ())
+ m_cleanupEvent.Cancel (); // cancel any scheduled cleanup events
+
+ clear ();
+}
+
void
CcnxPit::SetCleanupTimeout (const Time &timeout)
{
diff --git a/model/ccnx-pit.h b/model/ccnx-pit.h
index ed724fe..fb437a9 100644
--- a/model/ccnx-pit.h
+++ b/model/ccnx-pit.h
@@ -117,6 +117,11 @@
*/
CcnxPit ();
+ /**
+ * \brief Destructor
+ */
+ virtual ~CcnxPit ();
+
/*CcnxPitEntryContainer::type::iterator
Add (const CcnxInterestHeader &header, CcnxFibEntryContainer::type::iterator fibEntry, Ptr<CcnxFace> face);*/
@@ -191,7 +196,7 @@
EventId m_cleanupEvent; ///< \brief Cleanup event
Ptr<CcnxFib> m_fib; ///< \brief Link to FIB table
- PitBucket m_bucketsPerFace; ///< \brief pending interface counter per face
+ PitBucket m_bucketsPerFace; ///< \brief pending interface counter per face
};
///////////////////////////////////////////////////////////////////////////////
diff --git a/model/ccnx-rit.cc b/model/ccnx-rit.cc
index 6a7e556..3536ab5 100644
--- a/model/ccnx-rit.cc
+++ b/model/ccnx-rit.cc
@@ -75,7 +75,15 @@
{
}
-CcnxRit::~CcnxRit( ) { }
+CcnxRit::~CcnxRit( )
+{
+ NS_LOG_FUNCTION_NOARGS ();
+
+ if (m_cleanupEvent.IsRunning ())
+ m_cleanupEvent.Cancel (); // cancel any scheduled cleanup events
+
+ clear ();
+}
void
CcnxRit::SetRitTimeout (const Time &timeout)
@@ -111,7 +119,7 @@
CcnxRit::WasRecentlySatisfied (const CcnxInterestHeader &header)
{
NS_LOG_FUNCTION_NOARGS ();
- std::pair<CcnxRitByNonce::type::iterator,CcnxRitByNonce::type::iterator>
+ std::pair<CcnxRitByNonce::type::iterator,CcnxRitByNonce::type::iterator>
entries = get<nonce> ().equal_range (header.GetNonce ());
if (entries.first == end ())