fix merge problem that lost candidate queue changes
authorCraig Dowell <craigdo@ee.washington.edu>
Fri, 13 Jul 2007 14:05:12 -0700
changeset 1089 5ad63c15b7e4
parent 1088 488db5bf22c0
child 1090 66619752cb2e
child 1092 a5d807363dec
fix merge problem that lost candidate queue changes
src/routing/static-route-manager.cc
--- a/src/routing/static-route-manager.cc	Fri Jul 13 13:49:10 2007 -0700
+++ b/src/routing/static-route-manager.cc	Fri Jul 13 14:05:12 2007 -0700
@@ -477,8 +477,7 @@
       // tree (removing it from the candidate list in the 
       // process). 
       // Extract from the candidates the node with the lower key. 
-      v = candidate.Top();
-      candidate.Pop();
+      v = candidate.Pop();
       // Update stat field in vertex. 
       NS_DEBUG("SPFCalculate: Popping vertex" << v->m_vertexId);
       v->m_lsa->m_stat = StaticRouterLSA::LSA_SPF_IN_SPFTREE;
@@ -691,13 +690,14 @@
 
   for (int i = 0; i < 100; ++i)
     {
-      SPFVertex *v = candidate.Top ();
-      candidate.Pop ();
+      SPFVertex *v = candidate.Pop ();
       if (v->m_distanceFromRoot < lastDistance)
         {
           ok = false;
         }
       lastDistance = v->m_distanceFromRoot;
+      delete v;
+      v = 0;
     }
 
   // Build fake link state database; four routers (0-3), 3 point-to-point