-/* 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. */
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;
}