summaryrefslogtreecommitdiffstats
path: root/src/H5PB.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5PB.c')
-rw-r--r--src/H5PB.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/H5PB.c b/src/H5PB.c
index c67ae59..ad61657 100644
--- a/src/H5PB.c
+++ b/src/H5PB.c
@@ -468,7 +468,7 @@ H5PB__dest_cb(void *item, void H5_ATTR_UNUSED *key, void *_op_data)
/*-------------------------------------------------------------------------
* Function: H5PB_dest
*
- * Purpose: destroy the PB on the file.
+ * Purpose: Flush and destroy the PB on the file if it exists.
*
* Return: Non-negative on success/Negative on failure
*
@@ -477,7 +477,7 @@ H5PB__dest_cb(void *item, void H5_ATTR_UNUSED *key, void *_op_data)
*-------------------------------------------------------------------------
*/
herr_t
-H5PB_dest(H5F_t *f)
+H5PB_dest(H5F_t *f, const H5F_io_info2_t *fio_info)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -486,11 +486,14 @@ H5PB_dest(H5F_t *f)
/* Sanity checks */
HDassert(f);
- /* Destroy page buffer info, if there is any */
+ /* flush and destroy the page buffer, if it exists */
if(f->shared->page_buf) {
H5PB_t *page_buf = f->shared->page_buf;
H5PB_ud1_t op_data; /* Iteration context */
+ if(H5PB_flush(fio_info)<0)
+ HGOTO_ERROR(H5E_PAGEBUF, H5E_CANTFLUSH, FAIL, "can't flush page buffer")
+
/* Set up context info */
op_data.page_buf = page_buf;