From 1ee1415c67fc8fd2a3a413d8fe9e117dc4b2b867 Mon Sep 17 00:00:00 2001 From: Dongsheng Yang Date: Tue, 14 Feb 2017 19:39:49 +0800 Subject: [PATCH] librbd: use create/destroy methods in RemoveRequest Signed-off-by: Dongsheng Yang --- src/librbd/image/RemoveRequest.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librbd/image/RemoveRequest.cc b/src/librbd/image/RemoveRequest.cc index 98c0fef7cf6c8..24bc22beefe9f 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) { -- 2.39.5