]> AND Public Git Repository - simgrid.git/blobdiff - src/smpi/bindings/smpi_pmpi_comm.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix issues with attr and cloning
[simgrid.git] / src / smpi / bindings / smpi_pmpi_comm.cpp
index 1624842b2ee8349ffef618a36a58018d51eb3698..85dd53aa74154a1058dd80c7c349f5a44cee02cf 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2020. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -261,7 +261,7 @@ int PMPI_Attr_put(MPI_Comm comm, int keyval, void* attr_value) {
        ||keyval == MPI_UNIVERSE_SIZE||keyval == MPI_LASTUSEDCODE)
     return MPI_ERR_ARG;
   else
-  return comm->attr_put<simgrid::smpi::Comm>(keyval, attr_value);
+    return comm->attr_put<simgrid::smpi::Comm>(keyval, attr_value);
 }
 
 int PMPI_Errhandler_free(MPI_Errhandler* errhandler){
@@ -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;
 }