--- a/src/routing/static-route-manager.cc Fri Jul 13 14:37:00 2007 -0700
+++ b/src/routing/static-route-manager.cc Sun Jul 15 22:47:58 2007 -0700
@@ -56,6 +56,16 @@
SPFVertex::~SPFVertex ()
{
+ for ( t_listOfSPFVertex::iterator i = m_children.begin ();
+ i != m_children.end ();
+ i++)
+ {
+ SPFVertex *p = *i;
+ delete p;
+ p = 0;
+ *i = 0;
+ }
+ m_children.clear();
}
StaticRouteManagerLSDB::~StaticRouteManagerLSDB()
@@ -502,7 +512,7 @@
// Second stage of SPF calculation procedure's
// NOTYET: ospf_spf_process_stubs (area, area->spf, new_table);
- DeleteSPFVertexChain(m_spfroot);
+ delete m_spfroot;
m_spfroot = 0;
}
@@ -622,15 +632,6 @@
v->m_parent->m_children.push_back(v);
}
-void
-StaticRouteManager::DeleteSPFVertexChain(SPFVertex* spfroot)
-{
- // spfroot is the root of all SPFVertex created during the SPF process
- // each vertex has a list of children
- // Recursively, delete all of the SPFVertex children of each SPFVertex
- // then delete root itself
-}
-
} // namespace ns3
#ifdef RUN_SELF_TESTS
@@ -819,12 +820,11 @@
srmlsdb->Insert(lsa3->m_linkStateId, lsa3);
NS_ASSERT(lsa2 == srmlsdb->GetLSA(lsa2->m_linkStateId));
- // We need a dummy node to populate the routing tables
- Ptr<StaticRouterTestNode> n2 = Create<StaticRouterTestNode> ();
-
// XXX next, calculate routes based on the manually created LSDB
StaticRouteManager* srm = new StaticRouteManager();
- srm->DebugUseLsdb (srmlsdb);
+ srm->DebugUseLsdb (srmlsdb); // manually add in an LSDB
+ // Note-- this will succeed without any nodes in the topology
+ // because the NodeList is empty
srm->DebugSPFCalculate(lsa0->m_linkStateId); // node n0
// This delete clears the srm, which deletes the LSDB, which clears
--- a/src/routing/static-route-manager.h Fri Jul 13 14:37:00 2007 -0700
+++ b/src/routing/static-route-manager.h Sun Jul 15 22:47:58 2007 -0700
@@ -133,7 +133,6 @@
int SPFNexthopCalculation (SPFVertex* v, SPFVertex* w,
StaticRouterLinkRecord* l, uint32_t distance);
void SPFVertexAddParent(SPFVertex* v);
- void DeleteSPFVertexChain(SPFVertex* spfroot);
StaticRouterLinkRecord* SPFGetNextLink(SPFVertex* v, SPFVertex* w,
StaticRouterLinkRecord* prev_link);
void SPFIntraAddRouter(SPFVertex* v);