moved freeing of allvars, alldims, alltypes lists to nc4_nc4f_list_del

This commit is contained in:
Ed Hartnett 2019-07-16 16:16:11 -06:00
parent e9666f7333
commit b8e50c9254
3 changed files with 6 additions and 10 deletions

View File

@ -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;

View File

@ -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. */

View File

@ -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;