X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ffbe55360efde07c787741f05fe6410860c651fa..9f21f35eadfc5d1f43d3e7a4b591711fd7fb9616:/src/smpi/smpi_mpi_dt.cpp diff --git a/src/smpi/smpi_mpi_dt.cpp b/src/smpi/smpi_mpi_dt.cpp index 634ecf493f..e948b65137 100644 --- a/src/smpi/smpi_mpi_dt.cpp +++ b/src/smpi/smpi_mpi_dt.cpp @@ -436,7 +436,11 @@ void smpi_datatype_use(MPI_Datatype type){ #endif } -void smpi_datatype_unuse(MPI_Datatype type){ +void smpi_datatype_unuse(MPI_Datatype type) +{ + if (type == MPI_DATATYPE_NULL) + return; + if (type->in_use > 0) type->in_use--; @@ -444,9 +448,9 @@ void smpi_datatype_unuse(MPI_Datatype type){ static_cast((type)->substruct)->subtype_free(&type); } - if(type != MPI_DATATYPE_NULL && type->in_use == 0){ + if (type->in_use == 0) smpi_datatype_free(&type); - } + #if HAVE_MC if(MC_is_active()) MC_ignore(&(type->in_use), sizeof(type->in_use));