From c487d35f52f331d13e322e72c7b29d7e88243f45 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 15 May 2021 17:11:11 +0100 Subject: [PATCH] occult ilks: Fix dispose to actually work! (Fixes an ilk leak.) Signed-off-by: Ian Jackson --- src/occultilks.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/occultilks.rs b/src/occultilks.rs index 5bd9afad..b457dd05 100644 --- a/src/occultilks.rs +++ b/src/occultilks.rs @@ -65,8 +65,8 @@ impl OccultIlks { pub fn dispose(&mut self, id: OId) { let id: Id = id.0; let data = &mut self.table[id]; - let newrefcount = data.refcount.checked_sub(1).unwrap(); - if newrefcount == 0 { + data.refcount = data.refcount.checked_sub(1).unwrap(); + if data.refcount == 0 { let data = self.table.remove(id).unwrap(); self.lookup.remove(&data.k); } -- 2.30.2