From 6f6c01ee8df803f92822b7488391c7ddb4149d14 Mon Sep 17 00:00:00 2001 From: Edgar Gabriel Date: Fri, 7 Aug 2015 11:50:25 -0500 Subject: [PATCH] free the datatypes that were created using type_dup during file_set_view --- ompi/mca/io/ompio/io_ompio_file_open.c | 8 ++++++++ ompi/mca/io/ompio/io_ompio_file_set_view.c | 3 +++ 2 files changed, 11 insertions(+) diff --git a/ompi/mca/io/ompio/io_ompio_file_open.c b/ompi/mca/io/ompio/io_ompio_file_open.c index 769a833169..6b65b2fa80 100644 --- a/ompi/mca/io/ompio/io_ompio_file_open.c +++ b/ompi/mca/io/ompio/io_ompio_file_open.c @@ -380,6 +380,14 @@ ompio_io_ompio_file_close (mca_io_ompio_file_t *ompio_fh) ompi_datatype_destroy (&ompio_fh->f_iov_type); } + if ( MPI_DATATYPE_NULL != ompio_fh->f_etype ) { + ompi_datatype_destroy (&ompio_fh->f_etype); + } + if ( MPI_DATATYPE_NULL != ompio_fh->f_filetype ){ + ompi_datatype_destroy (&ompio_fh->f_filetype); + } + + if (MPI_COMM_NULL != ompio_fh->f_comm && (ompio_fh->f_flags & OMPIO_SHAREDFP_IS_SET) ) { ompi_comm_free (&ompio_fh->f_comm); } diff --git a/ompi/mca/io/ompio/io_ompio_file_set_view.c b/ompi/mca/io/ompio/io_ompio_file_set_view.c index 43f21af6b4..e6d84bc19c 100644 --- a/ompi/mca/io/ompio/io_ompio_file_set_view.c +++ b/ompi/mca/io/ompio/io_ompio_file_set_view.c @@ -139,6 +139,9 @@ int mca_io_ompio_file_set_view (ompi_file_t *fp, data = (mca_io_ompio_data_t *) fp->f_io_selected_data; fh = &data->ompio_fh; + ompi_datatype_destroy (&fh->f_etype); + ompi_datatype_destroy (&fh->f_filetype); + if (NULL != fh->f_decoded_iov) { free (fh->f_decoded_iov); fh->f_decoded_iov = NULL;