summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/H5G.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/H5G.c b/src/H5G.c
index 33338f4..4c44212 100644
--- a/src/H5G.c
+++ b/src/H5G.c
@@ -1288,9 +1288,11 @@ H5G_close(H5G_t *grp)
if (H5O_close(&(grp->ent)) < 0) {
HRETURN_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to close");
}
+ grp->nref = 0;
H5MM_xfree (grp);
+ } else {
+ --grp->nref;
}
- --grp->nref;
FUNC_LEAVE(SUCCEED);
}