summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2010-09-07 16:24:33 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2010-09-07 16:24:33 (GMT)
commitba35fd9890468f40ed2cd5b38adc2dbb81c82f7e (patch)
tree75fbb4639fa328702836fe4eaab3736cb7a54f61 /src
parent071703613374d4e050ccc3ec754eca57368b3d55 (diff)
downloadhdf5-ba35fd9890468f40ed2cd5b38adc2dbb81c82f7e.zip
hdf5-ba35fd9890468f40ed2cd5b38adc2dbb81c82f7e.tar.gz
hdf5-ba35fd9890468f40ed2cd5b38adc2dbb81c82f7e.tar.bz2
[svn-r19355] Quincey and I made H5Eset_current_stack also close the stack to be set. This is to
avoid H5Eclose_stack clearing the default stack. Please see bug 1799. Tested on jam - simple change. The changes to configure.in, tools/lib, config, c++/test, Makefile.am, and fortran are only property changes from the merge.
Diffstat (limited to 'src')
-rw-r--r--src/H5E.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/H5E.c b/src/H5E.c
index 5a431c6..0e0da0a 100644
--- a/src/H5E.c
+++ b/src/H5E.c
@@ -1000,13 +1000,19 @@ done:
/*-------------------------------------------------------------------------
* Function: H5Eset_current_stack
*
- * Purpose: Replaces current stack with specified stack.
+ * Purpose: Replaces current stack with specified stack. This closes the
+ * stack ID also.
*
* Return: Non-negative value on success/Negative on failure
*
* Programmer: Raymond Lu
* Friday, July 15, 2003
*
+ * Modification:
+ * Raymond Lu
+ * 7 September 2010
+ * Also closes the stack to avoid potential problem (bug 1799)
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1025,6 +1031,13 @@ H5Eset_current_stack(hid_t err_stack)
/* Set the current error stack */
if(H5E_set_current_stack(estack) < 0)
HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "unable to set error stack")
+
+ /*
+ * Decrement the counter on the error stack. It will be freed if the count
+ * reaches zero.
+ */
+ if(H5I_dec_ref(err_stack, TRUE) < 0)
+ HGOTO_ERROR(H5E_ERROR, H5E_CANTDEC, FAIL, "unable to decrement ref count on error stack")
} /* end if */
done: