Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix refcounting of smpi::Errhandler.
[simgrid.git] / src / smpi / bindings / smpi_pmpi_comm.cpp
index 9cefd11..d21205f 100644 (file)
@@ -292,7 +292,9 @@ int PMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler){
 
 int PMPI_Comm_call_errhandler(MPI_Comm comm,int errorcode){
   CHECK_COMM(1)
-  comm->errhandler()->call(comm, errorcode);
+  MPI_Errhandler err = comm->errhandler();
+  err->call(comm, errorcode);
+  simgrid::smpi::Errhandler::unref(err);
   return MPI_SUCCESS;
 }