From 18ff5d6e59e7977543def8ad3046f9dd1bdb7ee6 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 6 Jul 2017 16:06:33 +0800 Subject: [PATCH] Context: C_ContextsBase: delete enclosed contexts in dtor there are chances that these contexts are never finished/completed Fixes: http://tracker.ceph.com/issues/20432 Signed-off-by: Kefu Chai --- src/include/Context.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/include/Context.h b/src/include/Context.h index bf992d0a2bf..e30c3f68ce6 100644 --- a/src/include/Context.h +++ b/src/include/Context.h @@ -217,7 +217,11 @@ public: : cct(cct_) { } - + ~C_ContextsBase() override { + for (auto c : contexts) { + delete c; + } + } void add(ContextType* c) { contexts.push_back(c); }