diff options
author | Robb Matzke <matzke@llnl.gov> | 1998-04-28 13:59:08 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1998-04-28 13:59:08 (GMT) |
commit | 66071d5078ad9841c8fbb430881ae2c6e059886e (patch) | |
tree | 163bf340ff1c2dcc9aebc35a1bea296a8da0e623 /src/H5T.c | |
parent | 4dcf59ae4461eec74a180d77783d9064d2aa3a58 (diff) | |
download | hdf5-66071d5078ad9841c8fbb430881ae2c6e059886e.zip hdf5-66071d5078ad9841c8fbb430881ae2c6e059886e.tar.gz hdf5-66071d5078ad9841c8fbb430881ae2c6e059886e.tar.bz2 |
[svn-r377] Changes since 19980424
----------------------
./src/H5A.c
./src/H5T.c
Fixed memory leaks. More to come later but PureAtria doesn't
make a Linux version of purify and the free version doesn't
compile with the new SMP Linux kernels so I had to debug over
the internet on a day that Sprint seemed to be having routing
problems... oh well. I got rid of most of the leaks.
./src/H5Apublic.h
Includes H5Ipublic.h for types in the header file.
./src/H5O.c
Comments improved for H5O_read()
./test/tattr.c
Removed a non-ANSI empty initializer.
./test/dsets.c
Include <string.h>
./test/istore.c
Fixed a non-ANSI pointer conversion.
Diffstat (limited to 'src/H5T.c')
-rw-r--r-- | src/H5T.c | 57 |
1 files changed, 31 insertions, 26 deletions
@@ -250,6 +250,34 @@ H5T_init_interface(void) FUNC_LEAVE(ret_value); } + +/*------------------------------------------------------------------------- + * Function: H5T_unlock_cb + * + * Purpose: Clear the locked flag for a data type. This function is + * called when the library is closing in order to unlock all + * registered data types and thus make them free-able. + * + * Return: Success: 0 + * + * Failure: 0 + * + * Programmer: Robb Matzke + * Monday, April 27, 1998 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static intn +H5T_unlock_cb (void *dt, const void __unused__ *key) +{ + FUNC_ENTER (H5T_unlock_cb, FAIL); + assert (dt); + ((H5T_t*)dt)->locked = FALSE; + FUNC_LEAVE (0); +} + /*-------------------------------------------------------------------------- NAME H5T_term_interface @@ -333,33 +361,9 @@ H5T_term_interface(void) (cfunc)(FAIL, FAIL, pcdata, 0, NULL, NULL); } + /* Unlock all datatypes, then free them */ + H5I_search (H5_DATATYPE, H5T_unlock_cb, NULL); H5I_destroy_group(H5_DATATYPE); - H5T_NATIVE_CHAR_g = FAIL; - H5T_NATIVE_UCHAR_g = FAIL; - H5T_NATIVE_SHORT_g = FAIL; - H5T_NATIVE_USHORT_g = FAIL; - H5T_NATIVE_INT_g = FAIL; - H5T_NATIVE_UINT_g = FAIL; - H5T_NATIVE_LONG_g = FAIL; - H5T_NATIVE_LLONG_g = FAIL; - H5T_NATIVE_ULLONG_g = FAIL; - H5T_NATIVE_HYPER_g = FAIL; - H5T_NATIVE_UHYPER_g = FAIL; - H5T_NATIVE_INT8_g = FAIL; - H5T_NATIVE_UINT8_g = FAIL; - H5T_NATIVE_INT16_g = FAIL; - H5T_NATIVE_UINT16_g = FAIL; - H5T_NATIVE_INT32_g = FAIL; - H5T_NATIVE_UINT32_g = FAIL; - H5T_NATIVE_INT64_g = FAIL; - H5T_NATIVE_UINT64_g = FAIL; - H5T_NATIVE_ULONG_g = FAIL; - H5T_NATIVE_FLOAT_g = FAIL; - H5T_NATIVE_DOUBLE_g = FAIL; - H5T_NATIVE_TIME_g = FAIL; - H5T_NATIVE_STRING_g = FAIL; - H5T_NATIVE_BITFIELD_g = FAIL; - H5T_NATIVE_OPAQUE_g = FAIL; } @@ -2765,6 +2769,7 @@ H5T_close(H5T_t *dt) if (dt && H5T_COMPOUND == dt->type) { for (i = 0; i < dt->u.compnd.nmembs; i++) { H5MM_xfree(dt->u.compnd.memb[i].name); + H5T_close (dt->u.compnd.memb[i].type); } H5MM_xfree(dt->u.compnd.memb); H5MM_xfree(dt); |