Skip to content

Commit 6f6c01e

Browse files
committed
free the datatypes that were created using type_dup during file_set_view
1 parent 1ae4f8c commit 6f6c01e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

ompi/mca/io/ompio/io_ompio_file_open.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,14 @@ ompio_io_ompio_file_close (mca_io_ompio_file_t *ompio_fh)
380380
ompi_datatype_destroy (&ompio_fh->f_iov_type);
381381
}
382382

383+
if ( MPI_DATATYPE_NULL != ompio_fh->f_etype ) {
384+
ompi_datatype_destroy (&ompio_fh->f_etype);
385+
}
386+
if ( MPI_DATATYPE_NULL != ompio_fh->f_filetype ){
387+
ompi_datatype_destroy (&ompio_fh->f_filetype);
388+
}
389+
390+
383391
if (MPI_COMM_NULL != ompio_fh->f_comm && (ompio_fh->f_flags & OMPIO_SHAREDFP_IS_SET) ) {
384392
ompi_comm_free (&ompio_fh->f_comm);
385393
}

ompi/mca/io/ompio/io_ompio_file_set_view.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ int mca_io_ompio_file_set_view (ompi_file_t *fp,
139139
data = (mca_io_ompio_data_t *) fp->f_io_selected_data;
140140
fh = &data->ompio_fh;
141141

142+
ompi_datatype_destroy (&fh->f_etype);
143+
ompi_datatype_destroy (&fh->f_filetype);
144+
142145
if (NULL != fh->f_decoded_iov) {
143146
free (fh->f_decoded_iov);
144147
fh->f_decoded_iov = NULL;

0 commit comments

Comments
 (0)