From 5af880e4f4b5861cc484c628cd89a5c44d181c95 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 7 Jul 2024 20:44:40 +0000 Subject: [PATCH] fix reference count on punned ColumnFamily Arc Signed-off-by: Jason Volk --- src/database/database.rs | 2 +- src/database/map.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/database/database.rs b/src/database/database.rs index 06a2d88f..44bb655c 100644 --- a/src/database/database.rs +++ b/src/database/database.rs @@ -6,7 +6,7 @@ use crate::{cork::Cork, maps, maps::Maps, Engine, Map}; pub struct Database { pub db: Arc, - pub map: Maps, + map: Maps, } impl Database { diff --git a/src/database/map.rs b/src/database/map.rs index 0b007307..1b35a72a 100644 --- a/src/database/map.rs +++ b/src/database/map.rs @@ -233,7 +233,7 @@ fn open(db: &Arc, name: &str) -> Result> { // closing the database (dropping `Engine`). Since `Arc` is a sibling // member along with this handle in `Map`, that is prevented. Ok(unsafe { - Arc::decrement_strong_count(cf_ptr); + Arc::increment_strong_count(cf_ptr); Arc::from_raw(cf_ptr) }) }