Skip to content

Commit

Permalink
Fix DS examples (#307)
Browse files Browse the repository at this point in the history
* fixed missed closing of a dataset

* fixed missed closing of a dataset
  • Loading branch information
brtnfld authored Feb 4, 2021
1 parent c55ac8a commit a06693b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion hl/examples/ex_ds1.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@ main(void)
if (H5DSattach_scale(did, dsid, DIM1) < 0)
goto out;

/* close DS id */
/* close DS ids */
if (H5Dclose(dsid) < 0)
goto out;
if (H5Dclose(did) < 0)
goto out;

/* close file */
H5Fclose(fid);
Expand Down
3 changes: 2 additions & 1 deletion hl/fortran/examples/ex_ds1.f90
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,9 @@ PROGRAM example_ds

WRITE(*,'(/,5X,A,I0,2A,/)') 'Dimension Scale Label for dimension ', DIM2, ' is ... ', label(1:label_len)

! close DS id
! close DS ids
CALL H5Dclose_f(dsid, err)
CALL H5Dclose_f(did, err)

! close file
CALL H5Fclose_f(fid, err)
Expand Down

0 comments on commit a06693b

Please sign in to comment.