less chance to leak memory
see also: https://tracker.ceph.com/issues/37884
Signed-off-by: Kefu Chai <kchai@redhat.com>
}
}
- auto m = new MMonMgrReport();
+ auto m = ceph::make_message<MMonMgrReport>();
py_modules.get_health_checks(&m->health_checks);
py_modules.get_progress_events(&m->progress_events);
// TODO? We currently do not notify the PyModules
// TODO: respect needs_send, so we send the report only if we are asked to do
// so, or the state is updated.
- monc->send_mon_message(m);
+ monc->send_mon_message(std::move(m));
}
void DaemonServer::adjust_pgs()
metadata["addrs"] = stringify(client_messenger->get_myaddrs());
collect_sys_info(&metadata, g_ceph_context);
- MMgrBeacon *m = new MMgrBeacon(monc.get_fsid(),
+ auto m = ceph::make_message<MMgrBeacon>(monc.get_fsid(),
monc.get_global_id(),
g_conf()->name.get_id(),
addrs,
m->set_services(active_mgr->get_services());
}
- monc.send_mon_message(m);
+ monc.send_mon_message(std::move(m));
}
void MgrStandby::tick()