Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Link Topo and Comm in both directions, and fix memory leak.
[simgrid.git] / src / smpi / mpi / smpi_comm.cpp
index 6c2bacc..d8ca45b 100644 (file)
@@ -61,7 +61,6 @@ void Comm::destroy(Comm* comm)
     Comm::destroy(smpi_process()->comm_world());
     return;
   }
-  delete comm->topo_; // there's no use count on topos
   Comm::unref(comm);
 }
 
@@ -334,6 +333,7 @@ void Comm::unref(Comm* comm){
   if(comm->refcount_==0){
     comm->cleanup_smp();
     comm->cleanup_attr<Comm>();
+    delete comm->topo_; // there's no use count on topos
     delete comm;
   }
 }