From c36ffb7f7492273f61ad0ffc2efadc01acdd3616 Mon Sep 17 00:00:00 2001 From: Yunchuan Wen Date: Fri, 9 Dec 2016 13:12:05 +0800 Subject: [PATCH] log: use std::make_shared to replace new Signed-off-by: Yunchuan Wen --- src/common/LogClient.cc | 2 +- src/common/LogClient.h | 2 +- src/log/Log.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/LogClient.cc b/src/common/LogClient.cc index 353f94ba07bc..443e026ff5cb 100644 --- a/src/common/LogClient.cc +++ b/src/common/LogClient.cc @@ -197,7 +197,7 @@ void LogChannel::update_config(map &log_to_monitors, set_log_prio(prio); if (to_graylog && !graylog) { /* should but isn't */ - graylog = ceph::logging::Graylog::Ref(new ceph::logging::Graylog("clog")); + graylog = std::make_shared("clog"); } else if (!to_graylog && graylog) { /* shouldn't but is */ graylog.reset(); } diff --git a/src/common/LogClient.h b/src/common/LogClient.h index bf70e39a8052..8e150cf5327c 100644 --- a/src/common/LogClient.h +++ b/src/common/LogClient.h @@ -219,7 +219,7 @@ public: if (channels.count(name)) c = channels[name]; else { - c = LogChannelRef(new LogChannel(cct, this, name)); + c = std::make_shared(cct, this, name); channels[name] = c; } return c; diff --git a/src/log/Log.cc b/src/log/Log.cc index 9f174dfb735c..03e3c0de8f95 100644 --- a/src/log/Log.cc +++ b/src/log/Log.cc @@ -191,7 +191,7 @@ void Log::start_graylog() { pthread_mutex_lock(&m_flush_mutex); if (! m_graylog.get()) - m_graylog = Graylog::Ref(new Graylog(m_subs, "dlog")); + m_graylog = std::make_shared(m_subs, "dlog"); pthread_mutex_unlock(&m_flush_mutex); } -- 2.47.3