[svn-r15485] Purpose: Allow library to shut down properly when objects have reference count
> 1.
Description: Added a new field 'app_count' to H5I_id_info_t struct, to track
the reference count on an id due to the application. the old 'count' field
tracks the total. Generally any id visible to the application gets placed
in app_count. Added app_ref boolean parameter to H5I_inc_ref, H5I_dec_ref,
H5I_register, H5I_clear_type, and a few other functions, to specify whether
the operation(s) being performed on the id(s) are due to the application
(TRUE) or not (FALSE). Test added for this case.
Tested: kagiso, smirom, linew (h5committest)
This commit is contained in:
@@ -628,17 +628,17 @@ H5O_link_delete(H5F_t *f, hid_t dxpl_id, H5O_t UNUSED *open_oh, void *_mesg)
|
||||
hid_t file_id; /* ID for the file the link is located in (passed to user callback) */
|
||||
|
||||
/* Get a file ID for the file the link is in */
|
||||
if((file_id = H5F_get_id(f)) < 0)
|
||||
if((file_id = H5F_get_id(f, FALSE)) < 0)
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to get file ID")
|
||||
|
||||
/* Call user-defined link's 'delete' callback */
|
||||
if((link_class->del_func)(lnk->name, file_id, lnk->u.ud.udata, lnk->u.ud.size) < 0) {
|
||||
H5I_dec_ref(file_id);
|
||||
H5I_dec_ref(file_id, FALSE);
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_CALLBACK, FAIL, "link deletion callback returned failure")
|
||||
} /* end if */
|
||||
|
||||
/* Release the file ID */
|
||||
if(H5I_dec_ref(file_id) < 0)
|
||||
if(H5I_dec_ref(file_id, FALSE) < 0)
|
||||
HGOTO_ERROR(H5E_OHDR, H5E_CANTCLOSEFILE, FAIL, "can't close file")
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
|
||||
Reference in New Issue
Block a user