mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-18 15:55:12 +08:00
moved freeing of allvars, alldims, alltypes lists to nc4_nc4f_list_del
This commit is contained in:
parent
e9666f7333
commit
b8e50c9254
@ -719,11 +719,6 @@ NC_HDF4_close(int ncid, void *ignore)
|
||||
return NC_EHDFERR;
|
||||
free(hdf4_file);
|
||||
|
||||
/* Misc. Cleanup */
|
||||
nclistfree(h5->alldims);
|
||||
nclistfree(h5->allgroups);
|
||||
nclistfree(h5->alltypes);
|
||||
|
||||
/* Free the NC_FILE_INFO_T struct. */
|
||||
if ((retval = nc4_nc4f_list_del(h5)))
|
||||
return retval;
|
||||
|
@ -257,11 +257,6 @@ nc4_close_netcdf4_file(NC_FILE_INFO_T *h5, int abort, NC_memio *memio)
|
||||
if ((retval = nc4_rec_grp_del(h5->root_grp)))
|
||||
return retval;
|
||||
|
||||
/* Free lists of dims, groups, and types in the root group. */
|
||||
nclistfree(h5->alldims);
|
||||
nclistfree(h5->allgroups);
|
||||
nclistfree(h5->alltypes);
|
||||
|
||||
#ifdef USE_PARALLEL4
|
||||
/* Free the MPI Comm & Info objects, if we opened the file in
|
||||
* parallel. */
|
||||
|
@ -1380,6 +1380,12 @@ nc4_nc4f_list_del(NC_FILE_INFO_T *h5)
|
||||
{
|
||||
assert(h5);
|
||||
|
||||
/* Cleanup these (extra) lists of all dims, groups, and types. */
|
||||
nclistfree(h5->alldims);
|
||||
nclistfree(h5->allgroups);
|
||||
nclistfree(h5->alltypes);
|
||||
|
||||
/* Free the NC_FILE_INFO_T struct. */
|
||||
free(h5);
|
||||
|
||||
return NC_NOERR;
|
||||
|
Loading…
Reference in New Issue
Block a user