We were previously setting up a reference loop. But the only way
to get Sessions is via the Connection, so let's just give Sessions
the pointer, and give Connections a counted ref.
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
if (!s) {
s = new Session;
con->set_priv(s->get());
- s->con = con->get();
+ s->con = con;
dout(10) << " new session " << s << " con=" << s->con << " addr=" << s->con->get_peer_addr() << dendl;
}
std::map<void *, entity_name_t> notifs;
Session() : last_sent_epoch(0), con(0) {}
- ~Session() { if (con) con->put(); }
void add_notif(void *n, entity_name_t& name) {
notifs[n] = name;
}