chiark / gitweb /
occult ilks: Fix dispose to actually work! (Fixes an ilk leak.)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 May 2021 16:11:11 +0000 (17:11 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 May 2021 16:17:08 +0000 (17:17 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/occultilks.rs

index 5bd9afad62348cc571ebd8fb3c10c07903f55e89..b457dd050a9a54e6967e73e0793af7894d767223 100644 (file)
@@ -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);
     }