]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Context: C_ContextsBase: delete enclosed contexts in dtor 16159/head
authorKefu Chai <kchai@redhat.com>
Thu, 6 Jul 2017 08:06:33 +0000 (16:06 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 6 Jul 2017 08:10:02 +0000 (16:10 +0800)
there are chances that these contexts are never finished/completed

Fixes: http://tracker.ceph.com/issues/20432
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/include/Context.h

index bf992d0a2bf9bcfcfbaaedc2b14eae2411a1c93c..e30c3f68ce6ee8ee1d2be9f22b524afd89ccc2ab 100644 (file)
@@ -217,7 +217,11 @@ public:
     : cct(cct_)
   {
   }
-
+  ~C_ContextsBase() override {
+    for (auto c : contexts) {
+      delete c;
+    }
+  }
   void add(ContextType* c) {
     contexts.push_back(c);
   }