}
else if (m->maps.count(e)) {
ldout(cct, 3) << "handle_osd_map decoding full epoch " << e << dendl;
- OSDMap *new_osdmap = new OSDMap();
+ auto new_osdmap = std::make_unique<OSDMap>();
new_osdmap->decode(m->maps[e]);
emit_blacklist_events(*osdmap, *new_osdmap);
-
- delete osdmap;
- osdmap = new_osdmap;
+ osdmap = std::move(new_osdmap);
logger->inc(l_osdc_map_full);
}
Objecter::~Objecter()
{
- delete osdmap;
-
ceph_assert(homeless_session->get_nref() == 1);
ceph_assert(num_homeless_ops == 0);
homeless_session->put();
Finisher *finisher;
ZTracer::Endpoint trace_endpoint;
private:
- OSDMap *osdmap;
+ std::unique_ptr<OSDMap> osdmap;
public:
using Dispatcher::cct;
std::multimap<std::string,std::string> crush_location;
double osd_timeout) :
Dispatcher(cct_), messenger(m), monc(mc), finisher(fin),
trace_endpoint("0.0.0.0", 0, "Objecter"),
- osdmap(new OSDMap),
+ osdmap{std::make_unique<OSDMap>()},
max_linger_id(0),
keep_balanced_budget(false), honor_osdmap_full(true), osdmap_full_try(false),
blacklist_events_enabled(false),