Skip to content

Commit c056587

Browse files
committed
chore: Do an explicit drop in finalize function.
1 parent 94d9063 commit c056587

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/types/user_ptr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::{
44
cell::RefCell,
55
rc::Rc,
66
sync::{Mutex, RwLock, Arc},
7+
mem::drop,
78
};
89

910
use emacs_module::emacs_finalizer_function;
@@ -68,7 +69,7 @@ impl<'e, T: Transfer> FromLisp<'e> for &'e T {
6869
unsafe extern "C" fn finalize<T: Transfer>(ptr: *mut os::raw::c_void) {
6970
#[cfg(build = "debug")]
7071
println!("Finalizing {:#?} {}", ptr, T::type_name());
71-
Box::from_raw(ptr as *mut T);
72+
drop(Box::from_raw(ptr as *mut T));
7273
}
7374

7475
impl<T: Transfer> IntoLisp<'_> for Box<T> {

0 commit comments

Comments
 (0)