[MOAB-dev] r3892 - in MOAB/trunk/src/io: . mhdf/include mhdf/src

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Wed May 12 19:41:19 CDT 2010


Author: kraftche
Date: 2010-05-12 19:41:19 -0500 (Wed, 12 May 2010)
New Revision: 3892

Modified:
   MOAB/trunk/src/io/ReadHDF5.cpp
   MOAB/trunk/src/io/WriteHDF5.cpp
   MOAB/trunk/src/io/mhdf/include/mhdf.h
   MOAB/trunk/src/io/mhdf/src/tags.c
Log:
remove H5Tclose calls from tag data IO path

Modified: MOAB/trunk/src/io/ReadHDF5.cpp
===================================================================
--- MOAB/trunk/src/io/ReadHDF5.cpp	2010-05-12 22:10:02 UTC (rev 3891)
+++ MOAB/trunk/src/io/ReadHDF5.cpp	2010-05-13 00:41:19 UTC (rev 3892)
@@ -2613,6 +2613,7 @@
   mhdf_Status status;
   Tag tag = 0;
   hid_t read_type;
+  bool table_type;
   rval = create_tag( fileInfo->tags[tag_index], tag, read_type ); 
   if (MB_SUCCESS != rval)
     return error(rval);
@@ -2630,6 +2631,19 @@
       if (read_type) H5Tclose( read_type );
       return error(MB_FAILURE);
     }
+    
+    table_type = false;
+    if (read_type == 0) {
+      read_type = H5Dget_type( handles[1] );
+      if (read_type == 0) {
+        mhdf_closeData( filePtr, handles[0], &status );
+        mhdf_closeData( filePtr, handles[0], &status );
+        if (fileInfo->tags[tag_index].size <= 0) 
+          mhdf_closeData( filePtr, handles[2], &status );
+        return error(MB_FAILURE);
+      }
+      table_type = true;
+    }
 
     if (fileInfo->tags[tag_index].size > 0) {
       dbgOut.tprintf(3, "Read sparse data for tag \"%s\"\n", fileInfo->tags[tag_index].name );
@@ -2639,6 +2653,11 @@
       dbgOut.tprintf(3, "Read var-len sparse data for tag \"%s\"\n", fileInfo->tags[tag_index].name );
       rval = read_var_len_tag( tag, read_type, handles[0], handles[1], handles[2], num_ent, num_val );
     }
+
+    if (table_type) {
+      H5Tclose(read_type);
+      read_type = 0;
+    }
     
     mhdf_closeData( filePtr, handles[0], &status );
     if (MB_SUCCESS == rval && is_error(status))
@@ -2696,8 +2715,24 @@
       rval = error(MB_FAILURE);
       break;
     }
+    
+    table_type = false;
+    if (read_type == 0) {


More information about the moab-dev mailing list