From 77a66c85a066016d85b56b380b770cdc1a5c253e Mon Sep 17 00:00:00 2001 From: nick Date: Tue, 17 Sep 2013 17:30:33 +0100 Subject: [PATCH] serve: Move bitset freeing to after closing the mirror and clients --- src/serve.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/serve.c b/src/serve.c index e03812d..294da5f 100644 --- a/src/serve.c +++ b/src/serve.c @@ -831,9 +831,6 @@ void serve_cleanup(struct server* params, /* need to stop background build if we're killed very early on */ pthread_cancel(params->allocation_map_builder_thread); pthread_join(params->allocation_map_builder_thread, &status); - if (params->allocation_map) { - bitset_free( params->allocation_map ); - } int need_mirror_lock; need_mirror_lock = !server_start_mirror_locked( params ); @@ -849,6 +846,10 @@ void serve_cleanup(struct server* params, server_join_clients( params ); + if (params->allocation_map) { + bitset_free( params->allocation_map ); + } + if ( server_start_mirror_locked( params ) ) { server_unlock_start_mirror( params ); }