Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix memory leak with ns3 routing tables.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 8 Feb 2022 21:46:37 +0000 (22:46 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 8 Feb 2022 21:46:45 +0000 (22:46 +0100)
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();
   });