summaryrefslogtreecommitdiffstats
path: root/glusterfsd/src/glusterfsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'glusterfsd/src/glusterfsd.c')
-rw-r--r--glusterfsd/src/glusterfsd.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index 9b343f5..bce5bfd 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -647,27 +647,31 @@ cleanup_and_exit (int signum)
gf_log ("glusterfsd", GF_LOG_NORMAL, "shutting down");
- tmp_pool = ctx->pool;
- mem_pool_destroy (tmp_pool->frame_mem_pool);
- mem_pool_destroy (tmp_pool->stack_mem_pool);
- tmp_pool = NULL;
- mem_pool_destroy (ctx->stub_mem_pool);
-
/* Call fini() of FUSE xlator first */
trav = ctx->master;
- if (trav && trav->fini)
+ if (trav && trav->fini) {
+ THIS = trav;
trav->fini (trav);
+ }
/* call fini() of each xlator */
trav = NULL;
if (ctx->active)
trav = ctx->active->top;
while (trav) {
- if (trav->fini)
+ if (trav->fini) {
+ THIS = trav;
trav->fini (trav);
+ }
trav = trav->next;
}
+ tmp_pool = ctx->pool;
+ mem_pool_destroy (tmp_pool->frame_mem_pool);
+ mem_pool_destroy (tmp_pool->stack_mem_pool);
+ tmp_pool = NULL;
+ mem_pool_destroy (ctx->stub_mem_pool);
+
glusterfs_pidfile_cleanup (ctx);
exit (0);