diff options
Diffstat (limited to 'src/H5Oshared.c')
-rw-r--r-- | src/H5Oshared.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/H5Oshared.c b/src/H5Oshared.c index c898a10..8a0a291 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -40,7 +40,7 @@ static void *H5O_shared_decode (H5F_t*, hid_t dxpl_id, const uint8_t*, H5O_share static herr_t H5O_shared_encode (H5F_t*, uint8_t*, const void*); static void *H5O_shared_copy(const void *_mesg, void *_dest, unsigned update_flags); static size_t H5O_shared_size (const H5F_t*, const void *_mesg); -static herr_t H5O_shared_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg); +static herr_t H5O_shared_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg, hbool_t adj_link); static herr_t H5O_shared_link(H5F_t *f, hid_t dxpl_id, const void *_mesg); static herr_t H5O_shared_debug (H5F_t*, hid_t dxpl_id, const void*, FILE*, int, int); @@ -414,7 +414,7 @@ H5O_shared_size (const H5F_t *f, const void *_mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_shared_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg) +H5O_shared_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg, hbool_t adj_link) { const H5O_shared_t *shared = (const H5O_shared_t *) _mesg; herr_t ret_value=SUCCEED; /* Return value */ @@ -425,9 +425,10 @@ H5O_shared_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg) assert(f); assert(shared); - /* Decrement the reference count on the shared object */ - if(H5O_shared_link_adj(f,dxpl_id,shared,-1)<0) - HGOTO_ERROR (H5E_OHDR, H5E_LINK, FAIL, "unable to adjust shared object link count"); + /* Decrement the reference count on the shared object, if requested */ + if(adj_link) + if(H5O_shared_link_adj(f, dxpl_id, shared, -1)<0) + HGOTO_ERROR (H5E_OHDR, H5E_LINK, FAIL, "unable to adjust shared object link count") done: FUNC_LEAVE_NOAPI(ret_value); |