Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix memory leak with ns3 routing tables.
[simgrid.git] / src / surf / network_ns3.cpp
index f0708f3..08a88e1 100644 (file)
@@ -338,6 +338,7 @@ NetworkNS3Model::NetworkNS3Model(const std::string& name) : NetworkModel(name)
 
   s4u::Engine::on_platform_created_cb([]() {
     /* Create the ns3 topology based on routing strategy */
+    ns3::GlobalRouteManager::DeleteGlobalRoutes(); // just in case this callback is called twice
     ns3::GlobalRouteManager::BuildGlobalRoutingDatabase();
     ns3::GlobalRouteManager::InitializeRoutes();
   });