msg/DispatchQueue: fix message leak from discard_queue()

We need to drop the Message ref() here; the msgr owns one ref
independent of those from the intrusive_ptr's in the queue itself.

Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2012-11-17 16:36:44 -08:00
parent 183953e14b
commit c4caf871aa

View File

@ -127,8 +127,9 @@ void DispatchQueue::discard_queue(uint64_t id) {
i != removed.end();
++i) {
assert(!(i->is_code())); // We don't discard id 0, ever!
msgr->dispatch_throttle_release(
i->get_message()->get_dispatch_throttle_size());
Message *m = i->get_message();
msgr->dispatch_throttle_release(m->get_dispatch_throttle_size());
m->put();
}
}