From: Dongsheng Yang Date: Tue, 14 Feb 2017 11:39:49 +0000 (+0800) Subject: librbd: use create/destroy methods in RemoveRequest X-Git-Tag: v12.0.1~282^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1ee1415c67fc8fd2a3a413d8fe9e117dc4b2b867;p=ceph.git librbd: use create/destroy methods in RemoveRequest Signed-off-by: Dongsheng Yang --- diff --git a/src/librbd/image/RemoveRequest.cc b/src/librbd/image/RemoveRequest.cc index 98c0fef7cf6c..24bc22beefe9 100644 --- a/src/librbd/image/RemoveRequest.cc +++ b/src/librbd/image/RemoveRequest.cc @@ -37,8 +37,8 @@ RemoveRequest::RemoveRequest(IoCtx &ioctx, const std::string &image_name, con m_prog_ctx(prog_ctx), m_op_work_queue(op_work_queue), m_on_finish(on_finish) { m_cct = reinterpret_cast(m_ioctx.cct()); - m_image_ctx = new I((m_image_id.empty() ? m_image_name : std::string()), - m_image_id, nullptr, m_ioctx, false); + m_image_ctx = I::create((m_image_id.empty() ? m_image_name : std::string()), + m_image_id, nullptr, m_ioctx, false); } template @@ -448,7 +448,7 @@ template void RemoveRequest::handle_switch_thread_context(int r) { ldout(m_cct, 20) << ": r=" << r << dendl; - delete m_image_ctx; + m_image_ctx->destroy(); m_image_ctx = nullptr; if (m_ret_val < 0 && m_ret_val != -ENOENT) {