diff options
-rw-r--r-- | src/H5AC.c | 5 | ||||
-rw-r--r-- | src/H5F.c | 19 | ||||
-rw-r--r-- | src/H5Groot.c | 5 | ||||
-rw-r--r-- | src/H5MF.c | 1 |
4 files changed, 14 insertions, 16 deletions
@@ -751,6 +751,11 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id) HDassert(f); HDassert(f->shared->cache); +#if H5AC_DUMP_STATS_ON_CLOSE + /* Dump debugging info */ + H5AC_stats(f); +#endif /* H5AC_DUMP_STATS_ON_CLOSE */ + #if H5AC__TRACE_FILE_ENABLED if(H5AC_close_trace_file(f->shared->cache) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_close_trace_file() failed.") @@ -974,17 +974,8 @@ H5F_dest(H5F_t *f, hid_t dxpl_id) HDassert(f->shared); if(1 == f->shared->nrefs) { - /* Flush at this point since the file will be closed */ - /* (Only try to flush here if the file structure was successfully - * initialized (i.e., the file struct is being shutdown in an - * orderly manner with the 'closing' flag set) - */ - if(f->closing) { -#if H5AC_DUMP_STATS_ON_CLOSE - /* Dump debugging info */ - H5AC_stats(f); -#endif /* H5AC_DUMP_STATS_ON_CLOSE */ - + /* Release objects that depend on the superblock being initialized */ + if(f->shared->sblock) { /* Shutdown file free space manager(s) */ /* (We should release the free space information now (before truncating * the file and before the metadata cache is shut down) since the @@ -995,15 +986,13 @@ H5F_dest(H5F_t *f, hid_t dxpl_id) if(H5MF_close(f, dxpl_id) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "can't release file free space info") - } /* end if */ - /* Unpin the superblock, since we're about to destroy the cache */ - if(f->shared->sblock) { + /* Unpin the superblock, since we're about to destroy the cache */ if(H5AC_unpin_entry(f->shared->sblock) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FSPACE, H5E_CANTUNPIN, FAIL, "unable to unpin superblock") f->shared->sblock = NULL; - } + } /* end if */ /* Remove shared file struct from list of open files */ if(H5F_sfile_remove(f->shared) < 0) diff --git a/src/H5Groot.c b/src/H5Groot.c index 04f0e1a..0d21bfe 100644 --- a/src/H5Groot.c +++ b/src/H5Groot.c @@ -99,6 +99,7 @@ H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root) H5G_loc_t root_loc; /* Root location information */ htri_t stab_exists = -1; /* Whether the symbol table exists */ hbool_t sblock_dirty = FALSE; /* Whether superblock was dirtied */ + hbool_t path_init = FALSE; /* Whether path was initialized */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5G_mkroot, FAIL) @@ -235,6 +236,7 @@ H5G_mkroot(H5F_t *f, hid_t dxpl_id, hbool_t create_root) /* Create the path names for the root group's entry */ H5G_name_init(root_loc.path, "/"); + path_init = TRUE; f->shared->root_grp->shared->fo_count = 1; /* The only other open object should be the superblock extension, if it @@ -250,7 +252,8 @@ done: * allocated */ if(ret_value < 0) { if(f->shared->root_grp) { - H5G_name_free(root_loc.path); + if(path_init) + H5G_name_free(root_loc.path); if(f->shared->root_grp->shared) f->shared->root_grp->shared = H5FL_FREE(H5G_shared_t, f->shared->root_grp->shared); f->shared->root_grp = H5FL_FREE(H5G_t, f->shared->root_grp); @@ -964,6 +964,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC); HDassert(f); HDassert(f->shared); HDassert(f->shared->lf); + HDassert(f->shared->sblock); /* Free the space in aggregators */ /* (for space not at EOF, it may be put into free space managers) */ |