fix reference count on punned ColumnFamily Arc
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
56a1b0e761
commit
5af880e4f4
2 changed files with 2 additions and 2 deletions
|
@ -6,7 +6,7 @@ use crate::{cork::Cork, maps, maps::Maps, Engine, Map};
|
||||||
|
|
||||||
pub struct Database {
|
pub struct Database {
|
||||||
pub db: Arc<Engine>,
|
pub db: Arc<Engine>,
|
||||||
pub map: Maps,
|
map: Maps,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Database {
|
impl Database {
|
||||||
|
|
|
@ -233,7 +233,7 @@ fn open(db: &Arc<Engine>, name: &str) -> Result<Arc<ColumnFamily>> {
|
||||||
// closing the database (dropping `Engine`). Since `Arc<Engine>` is a sibling
|
// closing the database (dropping `Engine`). Since `Arc<Engine>` is a sibling
|
||||||
// member along with this handle in `Map`, that is prevented.
|
// member along with this handle in `Map`, that is prevented.
|
||||||
Ok(unsafe {
|
Ok(unsafe {
|
||||||
Arc::decrement_strong_count(cf_ptr);
|
Arc::increment_strong_count(cf_ptr);
|
||||||
Arc::from_raw(cf_ptr)
|
Arc::from_raw(cf_ptr)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue