diff --git a/src/transactions.rs b/src/transactions.rs index 73e8981d..369b2c60 100644 --- a/src/transactions.rs +++ b/src/transactions.rs @@ -737,7 +737,11 @@ impl WriteTransaction { if whitelist.contains(&page) { continue; } - freed_pages.push(page); + if self.mem.uncommitted(page) { + self.mem.free(page); + } else { + freed_pages.push(page); + } } *self.freed_pages.lock().unwrap() = freed_pages; self.tables.lock().unwrap().table_tree = TableTreeMut::new( @@ -777,8 +781,12 @@ impl WriteTransaction { && !freed_pages_hash.contains(&page) && !whitelist.contains(&page) { - freed_pages.push(page); - freed_pages_hash.insert(page); + if self.mem.uncommitted(page) { + self.mem.free(page); + } else { + freed_pages.push(page); + freed_pages_hash.insert(page); + } } } }