summaryrefslogtreecommitdiffstats
path: root/api/src
diff options
context:
space:
mode:
Diffstat (limited to 'api/src')
-rw-r--r--api/src/glfs.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/api/src/glfs.c b/api/src/glfs.c
index d21cb8b334f..babaf20cee3 100644
--- a/api/src/glfs.c
+++ b/api/src/glfs.c
@@ -1230,8 +1230,6 @@ pub_glfs_fini(struct glfs *fs)
if (ctx->mgmt) {
rpc_clnt_disable(ctx->mgmt);
- rpc_clnt_unref(ctx->mgmt);
- ctx->mgmt = NULL;
}
call_pool = fs->ctx->pool;
@@ -1349,6 +1347,13 @@ pub_glfs_fini(struct glfs *fs)
ret = -1;
}
+ /* Avoid dispatching events to mgmt after freed,
+ * unreference mgmt after the event_dispatch_destroy */
+ if (ctx->mgmt) {
+ rpc_clnt_unref(ctx->mgmt);
+ ctx->mgmt = NULL;
+ }
+
/* log infra has to be brought down before destroying
* timer registry, as logging uses timer infra
*/