From b67893f460c7a64d22e07f542761a04749c32d3c Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Wed, 3 Feb 2021 11:19:47 -0600 Subject: [PATCH 1/2] fixed missed closing of a dataset --- hl/examples/ex_ds1.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hl/examples/ex_ds1.c b/hl/examples/ex_ds1.c index af8b58155c3..09f398bd98a 100644 --- a/hl/examples/ex_ds1.c +++ b/hl/examples/ex_ds1.c @@ -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); From e5b8c8b202fb057e030f41ec68b33f6337164b45 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Wed, 3 Feb 2021 11:23:50 -0600 Subject: [PATCH 2/2] fixed missed closing of a dataset --- hl/fortran/examples/ex_ds1.f90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hl/fortran/examples/ex_ds1.f90 b/hl/fortran/examples/ex_ds1.f90 index b31ac8eba52..3e0048ad555 100644 --- a/hl/fortran/examples/ex_ds1.f90 +++ b/hl/fortran/examples/ex_ds1.f90 @@ -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)