diff options
Diffstat (limited to 'libstore')
-rw-r--r-- | libstore/make.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libstore/make.c b/libstore/make.c index 7ce320d5..d13f2516 100644 --- a/libstore/make.c +++ b/libstore/make.c @@ -29,7 +29,7 @@ struct store * _make_store (enum file_storage_class class, struct store_meths *meths, mach_port_t port, size_t block_size, - const off_t *runs, size_t num_runs, off_t end) + const struct store_run *runs, size_t num_runs, off_t end) { if (block_size & (block_size - 1)) return 0; /* block size not a power of two. */ @@ -53,6 +53,8 @@ _make_store (enum file_storage_class class, struct store_meths *meths, store->log2_blocks_per_page = 0; store->misc = 0; store->hook = 0; + store->children = 0; + store->num_children = 0; store->class = class; store->meths = meths; @@ -66,15 +68,23 @@ _make_store (enum file_storage_class class, struct store_meths *meths, void store_free (struct store *store) { + int k; + if (store->meths->cleanup) (*store->meths->cleanup) (store); + + for (k = 0; k < store->num_children; k++) + store_free (store->children[k]); + if (store->port != MACH_PORT_NULL) mach_port_deallocate (mach_task_self (), store->port); if (store->source != MACH_PORT_NULL) mach_port_deallocate (mach_task_self (), store->source); + if (store->name) free (store->name); if (store->runs) free (store->runs); + free (store); } |