[MOAB-dev] r1997 - MOAB/trunk/parallel

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Tue Jul 8 11:55:51 CDT 2008


Author: kraftche
Date: 2008-07-08 11:55:51 -0500 (Tue, 08 Jul 2008)
New Revision: 1997

Modified:
   MOAB/trunk/parallel/WriteHDF5Parallel.cpp
Log:
don't leak hdf5 resources on error

Modified: MOAB/trunk/parallel/WriteHDF5Parallel.cpp
===================================================================
--- MOAB/trunk/parallel/WriteHDF5Parallel.cpp	2008-07-08 16:48:31 UTC (rev 1996)
+++ MOAB/trunk/parallel/WriteHDF5Parallel.cpp	2008-07-08 16:55:51 UTC (rev 1997)
@@ -563,12 +563,12 @@
   hid_t hdf_opt = H5Pcreate( H5P_FILE_ACCESS );
   H5Pset_fapl_mpio( hdf_opt, MPI_COMM_WORLD, MPI_INFO_NULL );
   filePtr = mhdf_openFileWithOpt( filename, 1, &junk, hdf_opt, &status );
+  H5Pclose( hdf_opt );
   if (!filePtr)
   {
     writeUtil->report_error( "%s\n", mhdf_message( &status ) );
     return MB_FAILURE;
   }
-  H5Pclose( hdf_opt );
   
   return MB_SUCCESS;
 }




More information about the moab-dev mailing list