]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Continuation: delete self after calling _done()
authorYan, Zheng <zyan@redhat.com>
Wed, 27 Jan 2016 10:27:30 +0000 (18:27 +0800)
committerYan, Zheng <zyan@redhat.com>
Mon, 7 Mar 2016 07:59:13 +0000 (15:59 +0800)
make sure Continuation delete itself even when virtual function
_done() is overwrited.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/common/Continuation.h
src/mds/CInode.cc

index c7e3057467e70df1a239bbbbb13c7c0b5e96a1f7..856c6b8b47f693338d324770e8b9642041375448 100644 (file)
@@ -116,7 +116,6 @@ protected:
    virtual void _done() {
      on_finish->complete(rval);
      on_finish = NULL;
-     delete this;
      return;
    }
 
@@ -149,6 +148,7 @@ private:
     if (done ||
         (reported_done && stages_processing.empty())) {
       _done();
+      delete this;
     }
   }
 
index ea11314ce1ca4897a113ec54b974e5e62a961e3b..cf7b0031ee3f2a85329fe0efc0dcd03dc6183165 100644 (file)
@@ -3961,7 +3961,6 @@ next:
       if (fin) {
         fin->complete(get_rval());
       }
-      delete this;
     }
   };