summaryrefslogtreecommitdiffstats
path: root/src/H5Dchunk.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-08-13 17:09:55 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-08-13 17:09:55 (GMT)
commit7bcb57d5786db186cb683c2e1ef198dce68b41fa (patch)
treead0dccd3f67d4a2df12884d4f3ed56a33022b8b5 /src/H5Dchunk.c
parentaa13114bb834aaa847302223cc07d582a1ee259a (diff)
downloadhdf5-7bcb57d5786db186cb683c2e1ef198dce68b41fa.zip
hdf5-7bcb57d5786db186cb683c2e1ef198dce68b41fa.tar.gz
hdf5-7bcb57d5786db186cb683c2e1ef198dce68b41fa.tar.bz2
[svn-r17351] Description:
Clean up code (to align w/future sblock_mdc branch changes), tweak tests for [slightly] easier debugging, fix memory leak when copying chunked datasets with I/O filters, fix memory leak of free space section when it was exactly the right size to use for extending an existing block in the file. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'src/H5Dchunk.c')
-rw-r--r--src/H5Dchunk.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index b22a097..0d0c77a 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -3967,7 +3967,9 @@ H5D_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage)
{
H5D_chk_idx_info_t idx_info; /* Chunked index info */
H5O_layout_t layout; /* Dataset layout message */
+ hbool_t layout_read = FALSE; /* Whether the layout message was read from the file */
H5O_pline_t pline; /* I/O pipeline message */
+ hbool_t pline_read = FALSE; /* Whether the I/O pipeline message was read from the file */
htri_t exists; /* Flag if header message of interest exists */
herr_t ret_value = SUCCEED; /* Return value */
@@ -3984,6 +3986,7 @@ H5D_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage)
else if(exists) {
if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_PLINE_ID, &pline))
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get I/O pipeline message")
+ pline_read = TRUE;
} /* end else if */
else
HDmemset(&pline, 0, sizeof(pline));
@@ -3994,6 +3997,7 @@ H5D_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage)
else if(exists) {
if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_LAYOUT_ID, &layout))
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get layout message")
+ layout_read = TRUE;
} /* end else if */
else
HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, FAIL, "can't find layout message")
@@ -4010,6 +4014,14 @@ H5D_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage)
HGOTO_ERROR(H5E_DATASET, H5E_CANTDELETE, FAIL, "unable to delete chunk index")
done:
+ /* Clean up any messages read in */
+ if(pline_read)
+ if(H5O_msg_reset(H5O_PLINE_ID, &pline) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset I/O pipeline message")
+ if(layout_read)
+ if(H5O_msg_reset(H5O_LAYOUT_ID, &layout) < 0)
+ HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset layout message")
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_chunk_delete() */