]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: Fix leak of context
authorYan, Zheng <zheng.z.yan@intel.com>
Sat, 27 Apr 2013 03:04:38 +0000 (11:04 +0800)
committerSage Weil <sage@inktank.com>
Mon, 29 Apr 2013 04:15:25 +0000 (21:15 -0700)
Use Context::complete() to finish context, it frees the context
after executing Context::finish().

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mon/Paxos.cc
src/mon/Paxos.h

index 21b9343f14cf92116e3a38b248ff89a376f42817..46eaf88273d694254d31e68da7a4cd137f686c2b 100644 (file)
@@ -805,7 +805,7 @@ void Paxos::finish_queued_proposal()
             << " to finish" << dendl;
 
     proposals.pop_front();
-    proposal->finish(0);
+    proposal->complete(0);
   }
 }
 
index 8fcf66b25db95d03c50bbf5e6bc72800cf0b4fbf..ca467ce3db8711a487cd38940128f123976b76e8 100644 (file)
@@ -642,8 +642,10 @@ public:
       { }
 
     void finish(int r) {
-      if (proposer_context)
-        proposer_context->finish(r);
+      if (proposer_context) {
+       proposer_context->complete(r);
+       proposer_context = NULL;
+      }
     }
   };
   /**