- is->files[i].no_writes,
- is->files[i].no_reads,
- is->files[i].no_skip_writes,
- is->files[i].no_allocated,
- is->files[i].no_released,
- is->files[i].no_remap);
- xfree (is->files[i].fc_list);
- flush_block (is, i);
- bf_close (is->files[i].bf);
+ is->files[i].no_writes,
+ is->files[i].no_reads,
+ is->files[i].no_skip_writes,
+ is->files[i].no_allocated,
+ is->files[i].no_released,
+ is->files[i].no_remap);
+ if (is->files[i].bf)
+ {
+ if (is->files[i].head_is_dirty)
+ bf_write (is->files[i].bf, 0, 0, sizeof(ISAMC_head),
+ &is->files[i].head);
+ flush_block (is, i);
+ bf_close (is->files[i].bf);
+ }
+ xfree(is->files[i].fc_list);
+ xfree(is->files[i].alloc_buf);