Unverified Commit dab81f1d authored by Atkins, Charles Vernon's avatar Atkins, Charles Vernon Committed by GitHub
Browse files

Merge pull request #2002 from khuck/fixing_2001

helper: Avoid freeing Comm-held MPI_Comm more than once
parents 801cbe77 7b2ee235
......@@ -198,7 +198,9 @@ void CommImplMPI::Free(const std::string &hint)
if (m_MPIComm != MPI_COMM_NULL && m_MPIComm != MPI_COMM_WORLD &&
m_MPIComm != MPI_COMM_SELF)
{
CheckMPIReturn(MPI_Comm_free(&m_MPIComm), hint);
MPI_Comm mpiComm = m_MPIComm;
m_MPIComm = MPI_COMM_NULL; // prevent freeing a second time
CheckMPIReturn(MPI_Comm_free(&mpiComm), hint);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment