From: Yan, Zheng Date: Wed, 27 Jan 2016 10:27:30 +0000 (+0800) Subject: Continuation: delete self after calling _done() X-Git-Tag: v10.1.0~176^2~1^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c8609d1301efcb940e74537b23cd1d05c42235ed;p=ceph.git Continuation: delete self after calling _done() make sure Continuation delete itself even when virtual function _done() is overwrited. Signed-off-by: Yan, Zheng --- diff --git a/src/common/Continuation.h b/src/common/Continuation.h index c7e3057467e7..856c6b8b47f6 100644 --- a/src/common/Continuation.h +++ b/src/common/Continuation.h @@ -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; } } diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index ea11314ce1ca..cf7b0031ee3f 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -3961,7 +3961,6 @@ next: if (fin) { fin->complete(get_rval()); } - delete this; } };