summaryrefslogtreecommitdiffstats
path: root/src/H5HL.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5HL.c')
-rw-r--r--src/H5HL.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/H5HL.c b/src/H5HL.c
index 550d5f6..3d72889 100644
--- a/src/H5HL.c
+++ b/src/H5HL.c
@@ -68,7 +68,7 @@ static H5HL_t *H5HL_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udat
void *udata2);
static herr_t H5HL_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, H5HL_t *heap);
static herr_t H5HL_dest(H5F_t *f, H5HL_t *heap);
-static herr_t H5HL_clear(H5HL_t *heap);
+static herr_t H5HL_clear(H5HL_t *heap, hbool_t destroy);
/*
* H5HL inherits cache-like properties from H5AC
@@ -568,8 +568,10 @@ H5HL_dest(H5F_t UNUSED *f, H5HL_t *heap)
*-------------------------------------------------------------------------
*/
static herr_t
-H5HL_clear(H5HL_t *heap)
+H5HL_clear(H5HL_t *heap, hbool_t destroy)
{
+ herr_t ret_value = SUCCEED;
+
FUNC_ENTER_NOINIT(H5HL_clear);
/* check arguments */
@@ -578,7 +580,12 @@ H5HL_clear(H5HL_t *heap)
/* Mark heap as clean */
heap->cache_info.dirty = 0;
- FUNC_LEAVE_NOAPI(SUCCEED);
+ if (destroy)
+ if (H5HL_dest(NULL, heap) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy local heap collection");
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
} /* end H5HL_clear() */