From: Kefu Chai Date: Thu, 6 Jul 2017 08:06:33 +0000 (+0800) Subject: Context: C_ContextsBase: delete enclosed contexts in dtor X-Git-Tag: v12.1.1~161^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F16159%2Fhead;p=ceph.git 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 --- diff --git a/src/include/Context.h b/src/include/Context.h index bf992d0a2bf9..e30c3f68ce6e 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); }