From a43897b08e40f39c9dd38a54ec4890f5f86ee6f6 Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Thu, 10 Jun 2010 14:23:41 -0700 Subject: [PATCH] mon: delete Subscriptions, don't just clear them. Fixes minor memory leak. --- src/mon/Session.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mon/Session.h b/src/mon/Session.h index 2fc948a3845..73ec5d65cf8 100644 --- a/src/mon/Session.h +++ b/src/mon/Session.h @@ -78,8 +78,10 @@ struct MonSessionMap { void remove_session(MonSession *s) { assert(!s->closed); - for (map::iterator p = s->sub_map.begin(); p != s->sub_map.end(); ++p) + for (map::iterator p = s->sub_map.begin(); p != s->sub_map.end(); ++p) { p->second->type_item.remove_myself(); + delete p->second; + } s->sub_map.clear(); s->item.remove_myself(); if (s->inst.name.is_osd()) {