summaryrefslogtreecommitdiffstats
path: root/hl
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2005-02-18 15:42:55 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2005-02-18 15:42:55 (GMT)
commitb0b4bc02dd4746dd49b727e833b0d5564cf8305e (patch)
treec59418ef08b3b6feb4c0b4bf4f7948d84db81326 /hl
parentc9ff71abe4af4c7ece589d3dff6f6959d6fbb2f4 (diff)
downloadhdf5-b0b4bc02dd4746dd49b727e833b0d5564cf8305e.zip
hdf5-b0b4bc02dd4746dd49b727e833b0d5564cf8305e.tar.gz
hdf5-b0b4bc02dd4746dd49b727e833b0d5564cf8305e.tar.bz2
[svn-r10042] Purpose:
bug fix Description: a scale was deleted twice in one case Solution: check for the dimension , delete only for it Platforms tested: linux solaris Misc. update:
Diffstat (limited to 'hl')
-rw-r--r--hl/src/H5DS.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c
index b40f342..ba410ec 100644
--- a/hl/src/H5DS.c
+++ b/hl/src/H5DS.c
@@ -429,10 +429,18 @@ herr_t H5DSattach_scale(hid_t did,
/* store the IDX information (index of the dataset that has the DS) */
dsl.dim_idx = idx;
dsbuf[nelmts-1] = dsl;
-
+
/* create a new data space for the new references array */
- if ((sid = H5Screate_simple(1,&nelmts,NULL))<0)
+ dims = (hsize_t*) malloc ( (size_t)nelmts * sizeof (hsize_t));
+ if (dims == NULL)
goto out;
+ dims[0] = nelmts;
+
+ if ((sid = H5Screate_simple(1,dims,NULL))<0)
+ goto out;
+
+ if (dims)
+ free(dims);
/* create the attribute again with the changes of space */
if ((aid = H5Acreate(dsid,REFERENCE_LIST,tid,sid,H5P_DEFAULT))<0)
@@ -712,8 +720,8 @@ herr_t H5DSdetach_scale(hid_t did,
if (H5Gget_objinfo(dsid_j,".",TRUE,&sb4)<0)
goto out;
- /* same object, reset */
- if (sb3.fileno==sb4.fileno && sb3.objno==sb4.objno) {
+ /* same object, reset. we want to detach only for this DIM */
+ if (sb3.fileno==sb4.fileno && sb3.objno==sb4.objno && (int)idx==dsbuf[i].dim_idx) {
dsbuf[i].ref=0;
dsbuf[i].dim_idx=-1;
found_dset=1;