summaryrefslogtreecommitdiffstats
path: root/src/H5Pdxpl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Pdxpl.c')
-rw-r--r--src/H5Pdxpl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c
index 4fb2b07..84ac73c 100644
--- a/src/H5Pdxpl.c
+++ b/src/H5Pdxpl.c
@@ -573,6 +573,10 @@ H5Pset_data_transform(hid_t plist_id, const char* expression)
if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID")
+ /* See if a data transform is already set, and free it if it is */
+ if(H5P_get(plist, H5D_XFER_XFORM_NAME, &data_xform_prop) >= 0)
+ H5Z_xform_destroy(data_xform_prop);
+
/* Create data transform info from expression */
if(NULL == (data_xform_prop = H5Z_xform_create(expression)))
HGOTO_ERROR(H5E_PLINE, H5E_NOSPACE, FAIL, "unable to create data transform info")