diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2003-08-15 14:45:02 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2003-08-15 14:45:02 (GMT) |
commit | da1e2ca0893d82ae3faa42acebae48b428185d02 (patch) | |
tree | 36c68d4abedf388765f7cea36e758291ab18cd85 /src/H5HG.c | |
parent | 7f4843c06bfdf62da93f4e7a68fda17a3b3e3070 (diff) | |
download | hdf5-da1e2ca0893d82ae3faa42acebae48b428185d02.zip hdf5-da1e2ca0893d82ae3faa42acebae48b428185d02.tar.gz hdf5-da1e2ca0893d82ae3faa42acebae48b428185d02.tar.bz2 |
[svn-r7369] Purpose:
Bug fix
Description:
The metadata cache 'destroy' callback routines need the file handle in
order for certain callback routines (currently just the H5HG one) to perform
extra cleanups. The recent change to call the 'destroy' callback from the
'clear' callback omitted this parameter.
Solution:
Add the file handle to the metadata cache 'clear' callbacks.
Platforms tested:
FreeBSD 4.8 (sleipnir)
too small to need h5committest
Diffstat (limited to 'src/H5HG.c')
-rw-r--r-- | src/H5HG.c | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -119,7 +119,7 @@ static H5HG_heap_t *H5HG_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void static herr_t H5HG_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, H5HG_heap_t *heap); static herr_t H5HG_dest(H5F_t *f, H5HG_heap_t *heap); -static herr_t H5HG_clear(H5HG_heap_t *heap, hbool_t destroy); +static herr_t H5HG_clear(H5F_t *f, H5HG_heap_t *heap, hbool_t destroy); /* * H5HG inherits cache-like properties from H5AC @@ -519,8 +519,10 @@ H5HG_dest (H5F_t *f, H5HG_heap_t *heap) *------------------------------------------------------------------------- */ static herr_t -H5HG_clear(H5HG_heap_t *heap, hbool_t destroy) +H5HG_clear(H5F_t *f, H5HG_heap_t *heap, hbool_t destroy) { + herr_t ret_value = SUCCEED; + FUNC_ENTER_NOINIT(H5HG_clear); /* Check arguments */ @@ -529,13 +531,12 @@ H5HG_clear(H5HG_heap_t *heap, hbool_t destroy) /* Mark heap as clean */ heap->cache_info.dirty = 0; - if (destroy) { - heap->chunk = H5FL_BLK_FREE(heap_chunk,heap->chunk); - heap->obj = H5FL_ARR_FREE(H5HG_obj_t,heap->obj); - H5FL_FREE(H5HG_heap_t, heap); - } + if (destroy) + if (H5HG_dest(f, heap) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy global heap collection"); - FUNC_LEAVE_NOAPI(SUCCEED); +done: + FUNC_LEAVE_NOAPI(ret_value); } /* H5HG_clear() */ |