fix hdf5 warning after [a,b] = listvarinfile(...) 49/20749/2
Antoine ELIAS [Mon, 28 Jan 2019 08:00:30 +0000 (09:00 +0100)]
Change-Id: I75ceb48f18d580b6cc3be4f7595907d6600dd079

scilab/modules/hdf5/src/c/h5_readDataFromFile.c

index 5d95d72..e509f6f 100644 (file)
@@ -440,7 +440,18 @@ void closeDataSet(int _id)
 {
     if (_id > 0)
     {
-        herr_t status = H5Dclose(_id);
+        H5O_info_t info;
+        herr_t status;
+        H5Oget_info(_id, &info);
+        if (info.type == H5O_TYPE_GROUP)
+        {
+            status = H5Gclose(_id);
+        }
+        else
+        {
+            status = H5Dclose(_id);
+        }
+
         if (status < 0)
         {
             return;