aquatic_ws: reclaim pending_scrape_slab memory after entry removal

This commit is contained in:
Joakim Frostegård 2021-11-01 21:40:41 +01:00
parent 7ae7442284
commit 07e1b8230f

View file

@ -416,7 +416,10 @@ impl ConnectionWriter {
if let Some(out_message) = opt_message {
self.send_out_message(&out_message).await?;
RefCell::borrow_mut(&self.pending_scrape_slab).remove(pending_scrape_id.0);
let mut slab = RefCell::borrow_mut(&self.pending_scrape_slab);
slab.remove(pending_scrape_id.0);
slab.shrink_to_fit();
}
}
out_message => {